http
Provides methods for working with HTTP(S)
assertCookie
Assert if HTTP cookie is presented in the response
Parameters:
cookieName
String
A HTTP cookie name.
cookieValuePattern
String
optional
An optional HTTP cookie value pattern.
assertHeader
Assert if HTTP header is presented in the response
Parameters:
headerName
String
A HTTP header name.
headerValuePattern
String
optional
An optional HTTP header value pattern.
assertResponseTime
Assert response time
Parameters:
maxTime
Number
Maximum response time in milliseconds.
assertStatus
Assert the last HTTP response's status code
Parameters:
codeList
Number
|Array
A single status code or a list of codes.
assertStatusOk
Assert HTTP 200 OK status
assertText
Assert whether the specified pattern is present in the response body.
Parameters:
pattern
String
Pattern to assert.
delete
Performs HTTP DELETE
Parameters:
url
String
URL.
headers
Object
optional
HTTP headers.
data
Object
Data.
Returns:
Object
- Response object.
get
Performs HTTP GET
** Usage example:**
Parameters:
url
String
URL.
headers
Object
optional
HTTP headers.
Returns:
Object
- Response object.
getResponse
Returns last response object
Returns:
Object
- Response object.
getResponseBody
Returns last response body
Returns:
String
- Response body.
getResponseHeaders
Returns response headers
Returns:
Object
- Response headers.
getResponseUrl
Returns response URL
Returns:
String
- Response URL.
patch
Performs HTTP PATCH
Parameters:
url
String
URL.
data
Object
Data.
headers
Object
optional
HTTP headers.
Returns:
Object
- Response object.
post
Performs HTTP POST
Parameters:
url
String
URL.
data
Object
Data.
headers
Object
optional
HTTP headers.
isFormData
Boolean
optional
Indicates if "data" parameter is of URL-encoded form type.
Returns:
Object
- Response object.
put
Performs HTTP PUT
Parameters:
url
String
URL.
data
Object
Data.
headers
Object
optional
HTTP headers.
Returns:
Object
- Response object.
setNtlmUser
Sets user credentials for NTLM authentication process
Parameters:
username
String
NTLM username.
password
String
NTLM password.
domain
String
optional
NTLM domain name, if applicable.In addition to the options listed in the linked document, 'deflateRaw' option can be used when server returns Deflate-compressed stream without headers.
setOptions
Sets user defined HTTP options (such as proxy, decompress and etc.)
Parameters:
opts
Object
HTTP request options object, see Request Options. In addition to the options listed in the linked document, 'deflateRaw' option can be used when server returns Deflate-compressed stream without headers.
setProxy
Sets proxy url to be used for connections with the service.
Parameters:
url
String
Proxy server URL. Not passing this argument will reset the proxy settings.
transaction
Opens new transaction.
The transaction will persist till a new one is opened. Transaction names must be unique.
Parameters:
name
String
The transaction name.
Last updated