HTTP Response reference
Response properties
The response
object holds the information about a received HTTP Response (response content, headers, status, and so on) and provides access to the headers and contentType nested objects.
Property | Description |
---|---|
| Response content, which can be a string, a LineStreamResponse object, or a JSON object. |
| |
| Response status, for example, 200 or 404. |
| The contentType object, which holds the data on the Content-Type response header value. |
Headers object
The ResponseHeaders
object is used for retrieving the data about response headers' values.
Methods
Method | Parameters | Description |
---|---|---|
valueOf |
| Retrieves the first value of the |
valuesOf |
| Retrieves the array containing all values of the |
ContentType object
The ContentType
data object contains information from the Content-Type response header.
Properties
Property | Description |
---|---|
| The MIME type of the response, for example, text/plain, text/xml, application/json. |
| The string representation of the response charset, for example, utf-8. |
LineStreamResponse object
The LineStreamResponse
interface is used to process a response as a stream of lines. It implements a onEachLine(line, unsubscribe)
method, which loops through each line in the stream, one after the other. The method takes two arguments:
Arguments
Argument | Description |
---|---|
| A line (event) received as part of the stream. |
| Function to terminate execution of the |
Request properties
The request
object holds the information about the HTTP request and can be used both in pre-request scripts and in response handler scripts.
Property | When used in pre-request scripts | When used in response handler scripts |
---|---|---|
| The request body obtained using one of two methods:
| The request body as a string, for example |
| Has the | |
| Has two methods:
| |
Each of the elements of the array is a request header with the following methods:
| Each of the elements of the array is a request header with the following methods:
| |
| The request URL obtained using one of two methods:
| The request URL as a string. |
| Has the |