Xojo.Net.HTTPSocket.RequestHeader
From Xojo Documentation
Method
Gets the request header with the key of name. The Name parameter's encoding is converted to ASCII. If the header does not exist in the request headers, an empty Text is returned. Raises a RuntimeException if the encoding could not be converted to ASCII.
Method
Xojo.Net.HTTPSocket.RequestHeader(name As Text, Assigns value As Text)
Supported for all project types and targets.
Supported for all project types and targets.
Sets the request header with the key of name. The Name parameter's encoding is converted to ASCII. If the header does not exist in the request headers, an empty Text is returned. Raises a RuntimeException if the encoding could not be converted to ASCII.
Parameters
Parameter | Description |
---|---|
name | The name of the key to get or set. |
value | The value for the key. |
Sample Code
Sets an API key as a token in the request header:
Self.RequestHeader("Authorization") = "MyAPIKey"
mySocket.Send("GET", "http://www.webservice.com/GetData")
mySocket.Send("GET", "http://www.webservice.com/GetData")