Authenticate the client session with a username and password.
This method returns a Boolean value. If the method succeeds, the return value is true. If the method fails, the return value is false. To get extended error information, check the value of the LastError property.
This method will set the Authorization request header for the client session using the credentials provided by the caller. This method will always override any custom Authorization header value which may have been previously set using the SetHeader method.
If both the userName and userPassword parameters specify empty strings, the current authentication type will always be set to HttpAuthentication.authNone regardless of the value of the authType parameter. This effectively clears the current user credentials for the client session.
If you provide a user name and password to the Connect method, or you set the UserName property and either the Password or BearerToken property prior to calling the Connect method, authentication will be automatically attempted at the time the connection is made. This method is only required if you do not provide user credentials when the connection is established and wish to authenticate the client session at a later time.
HttpClient Class | SocketTools Namespace | HttpClient.Authenticate Overload List | Authentication Property | BearerToken Property | Password Property | UserName Property | SetHeader Method