Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing JSON to http Post?
Message
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01646398
Message ID:
01646416
Views:
34
Another follow up to my message.
I commented the following line in Thomas Holste's code:
*-- loHttp.cExtraHeaders = "content-type:application/json" + CHR(13) + CHR(10)
Then, when the host is called, the Result is 200. And the Fiddler shows:
Content-Type: application/x-www-form-urlencoded
So, no error. But the posting is not done. Of course, it could be a problem with Web API.

>Just a follow up to my earlier message. I see in Fiddler that o the line where the Web API is called and the Result is 500, the Body column is 0 and the Content-type is empty. Where I am pretty sure that the Content-type should have the
>entry "application/json". And yet in the Raw section of the Fiddler the Content-type is"
>
>Content-Type: application/json
>
>Confused.
>
>>Thank you for the explanation, Thomas. I am getting result 500 (which I understand is the server error) and I am not sure if I am doing something wrong in my VFP code or there is different problem. I will keep on trying.
>>
>>>Hi Dmitri,
>>>
>>>the name of the method ("httpget") misleads you. In the help for this method the following is written:
>>>
>>>"The method can POST data to the server by calling AddPostKey() to calling HTTPGet. Any other properties of the wwIPStuff object that affect an HTTP connection (nHTTPPostMode,nHTTPConnectType etc.) can be set prior to calling this method with exception of the following that are retrieved from the URL:..."
>>>
>>>And this is what I do. First add a postkey (The json-string with the login-information) and then the httpget (which really does a post in this case).
>>>
>>>Best regards
>>>
>>>Thomas
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform