Classes

Method HttpClient():setOption() Foundation

Changes a HttpClient option.

Syntax
 
:setOption( <cName>[, <xValue>] ) --> self
Parameters
<cName>
<cName> is a character string identifying an option.
<xValue>
The expression <xValue> specifies the value for a option. The data type and value is dependent on the HttpClient option designated by <cName>.
Return

:setOption() returns the object executing the method.

Description

The method :setOption() changes a HttpClient option. The option is identified by the character string passed in the parameter <cName>. The method :setOption() must be called before one of the methods :send(), :sendAsync() or :getFile() is executed for the first time. Afterwards, the options can no longer be changed.

The following table lists the valid options and their respective values.

Available options
Option-Name Value *) Description
disable-redirect n/a Disables automatic redirects.
secure-protocol "ssl-2.0", "ssl-3.0", "tls-1.0", "tls-1.1", "tls-1.2", "tls-1.3" Enforces a specific Transport Layer Security protocol for communication.
  1. n/a indicates no xValue parameter required

disable-redirect

Disables automatic redirects. By default, HTTP clients automatically follow redirects by re-sending the request to the redirected address. If redirect is disabled, it cannot be enabled without creating a new HttpClient object.

secure-protocol

By default, all secure protocols of the operating system are offered to the server. Using the "secure-protocol" option, the offered secure protocols can be restricted to either a single or a specific set of desired secure protocols. In order to enforce usage of a single secure protocol, a character string with the desired TLS protocol version must be passed in the <xValue> parameter. If the communication is to be limited to more than one TLS protocol version, the desired versions must be passed in an array. Example: {"tls-1.1","tls-1.2"}

Feedback

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.