Artax ⋅ Configuration
DefaultClient follows redirects by default. There are several other options that can be configured. These can either be configured when constructing a new
DefaultClient object, or when making a request.
setOptions. The former accepts one of the option constants and a value, while the latter accepts an associative array mapping option constants to values.
Be careful with client-wide options that change the behavior of the client. While sometimes useful, changing them client-wide is discouraged. Use per-request configuration instead.
These options can also be passed for specific requests in the
request method as second parameter. The
$options parameter accepts an associative array mapping from
Client constants to values like
setOptionsare by-design not part of the
Clientinterface. Setting the options for specific requests is the preferred method of configuration.
||Whether to automatically apply compression to requests and responses.|
||Whether to automatically add a “Referer” header on redirects.|
||Default headers to send.|
||Whether to directly discard the HTTP response body or not.|
||Maximum body size. Set to
||Maximum header size, usually doesn’t have to be adjusted.|
||How many redirects to follow, might be
||Transfer timeout in milliseconds until an HTTP request is automatically aborted, use