Method HttpClient():setAuthorization() Foundation
Sets username and password for server authentication.
:setAuthorization( [<cUsername>, <cPassword>] ) --> self
:setAuthorization() returns the object executing the method.
The method :setAuthorization() specifies the credentials for the user to be authenticated on the server for performing subsequent requests. These credentials can later be reset by calling :setAuthorization() without parameters. Afterwards, no user will be authenticated when performing requests.
The method :setAuthorization() automatically enforces negotiation with the server regarding the authentication scheme to be used. Suppported schemes are listed below.
Scheme | Description |
---|---|
Basic | User name and password are sent to the server as a Base64-encoded string |
NTLM | NT LAN Manager Authentication |
Digest | Digest Access Authentication |
Negotiate *) | Uses NTLM or Kerberos authentication depending on client and server OS |
|
In case the Basic authentication scheme is used, the credentials specified in the parameters to :setAuthorization() are stored in the "Authorization" header element of the HTTP request object assigned to the :httpRequest member variable. This HTTP request object is used as the default for requests sent using the methods :send() and :sendAsync().
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.