Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DllExport class
Message
From
18/11/2016 06:02:54
 
General information
Forum:
ASP.NET
Category:
Other
Title:
Environment versions
Environment:
C# 5.0
OS:
Windows 10
Database:
MS SQL Server
Miscellaneous
Thread ID:
01643554
Message ID:
01643667
Views:
24
This message has been marked as a message which has helped to the initial question of the thread.
>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-client
>
>but 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.

I'd not heard of Postman-Token but it appears that it is there to ensure a unique request. Looking at this example seems to indicate you could just use a new GUID as a unique value ? :
http://stackoverflow.com/questions/36883046/what-is-the-postman-token-in-generated-code-from-postman.

Re: number of tries : is the server expecting such data ?
If it is for your own use and the server returns the same Postman-Token then maybe you could concatenate the try number value to the GUID ?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform