-
Notifications
You must be signed in to change notification settings - Fork 1
Config Variables
Peter Thomas edited this page Dec 7, 2023
·
6 revisions
Config variables have the effect of changing global "behavior" and are identified by a leading underscore, for example: _url
.
Anything set this way will apply to all requests, unless you over-ride them. Any other variables will be treated as normal global variables.
Name | Type | Effect |
---|---|---|
_url |
string | Default "base URL" for all requests |
_headers |
json | Sets headers for all requests |
_cookies |
json | Sets cookies for all requests |
_ssl |
boolean / json | Set this to (true) if you have to test HTTPS and the server is strict |
_charset |
string | Set this to (null) if you want to not append ; charset=UTF-8 to the Content-Type header |
_followRedirects |
boolean | Set this to (false) to not follow redirects by default |
_connectTimeout |
number | Increase the connect timeout which defaults to (30000) (30 seconds) |
_readTimeout |
number | Increase the read timeout which defaults to (30000) (30 seconds) |
_proxy |
string / json | The URI of the proxy server to use |
For more details, you can also refer to the corresponding configure keys in the Karate engine that is used behind the scenes.
Those that expect a JSON can also be a JS function that returns a JSON, allowing for some very dynamic behavior.