Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create HTTP Request object
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01645753
Message ID:
01646172
Views:
61
You don't need to use that anymore there's an **.AddHeader()** method that does the right thing.

+++ Rick ---

>Hi Dmitry,
>
>wwhttp has a property called cExtraheaders where you can add additional header- data.
>
>
>this.oHTTP.cExtraHeaders = "accept:application/json" + CHR(13) + CHR(10) ;
>       + "Authorization:Bearer" + this.cToken  + CHR(13) + CHR(10)
>
>
>In this example this adds a line for the data-format needed and a line to send a token (Session-ID).
>But in most HTTP-Services the authorisation is done by either using POST like
>
>
>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)
>
>
>or as also mentioned before by using a GET with added parameters like:
>
>
>cHttp = this.cUrl + "Login?anmeldename=" + this.cUser + "&passwort=" + this.cPasswort
>cResult = this.oHTTP.HTTPGet(cHttp) 
>
>
>Best regards
>
>Thomas
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Reply
Map
View

Click here to load this message in the networking platform