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:
01646412
Views:
39
Hi Thomas (and Thomas Ganss),

Thank you for your code. I wonder why if this code is supposed to do posting, it is using HTTPGet method (emphasis on GET)? When I was initially working on this code I was using HTTPPost method. I am sure this shows my lack of understanding of the basics of HTTP but I am coming out of the closet :).


>Hi Dmitry,
>
>this is how I send Json by using the addpostkey-method:
>
>
>cLoginURL = this.cURL + "login"
>cContent = "{ " + Chr(34) + "username" + Chr(34) + " : " + Chr(34) + this.cUser + Chr(34) + ", " + Chr(34) + "password" + Chr(34) + " : " + Chr(34) + this.cPasswort + Chr(34) + "}"
>this.oHTTP = CREATEOBJECT("wwhttp")
>this.oHTTP.AddPostKey(cContent)
>this.oHTTP.cExtraHeaders = "content-type:application/json" + CHR(13) + CHR(10)
>lcHTML = this.oHTTP.HTTPGet(cLoginURL)
>IF this.oHTTP.cResultcode = "200"
>...
>
>
>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