Viv,
Do you know a good example of using HttpClient ? I found this link
https://www.asp.net/web-api/overview/advanced/calling-a-web-api-from-a-net-clientbut it does not recognize PostAsJsonAsync when I try to use that code.
UPDATE. Found this
http://stackoverflow.com/questions/19158378/httpclient-not-supporting-postasjsonasync-method-c-sharp so I am going to add an extension as that thread suggests.
Also, I'm not clear how to set the properties I need.
The sample call which I need to use is the following:
POST /integrationapi//Attraction/Tickets/Validate HTTP/1.1
Host: hostsitehere
Content-Type: application/json
Authorization: Basic encodedstringhere
Cache-Control: no-cache
Postman-Token: encodedstringhere
{
"TicketUsageRequests": [
{
"TicketBarcode": barcodehere",
"TicketUsageDate": "2016-10-28T15:09:06.7021957-06:00",
"UserID": "userNameHere"
}
]
}
Thanks a lot in advance.
I also found how to set Authorization. I'm not sure about Cache-Control and Postman-Token. Also, my function is going to pass number of tries. What exactly would it mean in terms of programmin.
If it's not broken, fix it until it is.
My Blog