:SetRequestHeader()
Class
Syntax
:SetRequestHeader(cHeader, cValue) -> lSuccess
Parameters
|
|
cHeader |
The Header to assign a value |
|
|
cValue |
The value to assign to the Header |
Return
Logical indicating Success.
Returns .T. if the operation succeeds, otherwise returns .F.
Description
Set the value of a header field. Some headers are generated by methods that send resource requests. Some of these are supplied by the requesting method only if the application has not previously defined the header. For others, the requesting method overrides what the application may have defined.
The affected headers include:
|
|
Host This is generated by the requesting function if the application hasn't defined the header already. | |
|
|
Connection This is generated in accordance with the settings of the KeepAlive option and the version of the HTTP protocol being used. | |
|
|
Accept This is generated (with a value of */*) for GET (which includes :GetFile() and :OpenFile()) and HEAD requests if the application hasn't defined the header already. | |
|
|
"Pragma: no-cache" is generated unconditionally for GET and HEAD requests. | |
|
|
"Content-Type: application/x-www-form-urlencoded" is generated for POST requests (which includes :SubmitQuery()) unless :SetEncodingType() has been used to prevent URL-encoding of data. | |
|
|
Content-Type This is generated unconditionally by :CreateFile(), according to the type of the file that is being sent to the server. | |
|
|
Content-Length This is generated unconditionally for POST (including :SubmitQuery()) and PUT (:CreateFile()) requests. | |
|
|
Proxy-Authorization This is generated for proxied connections for which a username and password has been specified. | |
|
|
Authorization This is generated if authentication has been specified. | |
See Also
:GetRequestHeader(), :GetResponseHeader(), :SetEncodingType(), :GetFile(), :OpenFile(), :PutFile(), :SendRequest(), :SubmitQuery(), :CreateFile(), :Authenticate(), :ProxyConnect()