HTTP
The HTTP collector provides a base configuration for making HTTP requests to REST APIs.
Configuration
Section titled “Configuration”-
base_url- Optional Template (string)BaseURL is the base URL for the HTTP collector, such as "https://api.example.com".
-
headers- Optional Template (map[string]string)Headers to include in all requests.
-
auth- Optional AHTTPAuthblock as defined below. -
timeout- Optional (int)Timeout is the request timeout in seconds.
-
insecure- Optional (bool)Insecure skips TLS certificate verification.
HTTPAuth
-
basic- Optional AHTTPBasicAuthblock as defined below.
HTTPBasicAuth
-
username- Optional Template (string) -
password- Optional Template (string) -
encoded- Optional Template (string)Encoded is a pre-encoded Base64-encoded credentials.
Example
Section titled “Example”collectors: - id: api http: base_url: https://api.example.com headers: Accept: application/json auth: basic: username: admin password: secret timeout: 30HTTP GET
Section titled “HTTP GET”Use the HTTP GET step to make requests via the HTTP collector. It is especially useful for external or internal services exposing a REST API.
Configuration
Section titled “Configuration”-
path- Optional (string)Path is the request path.
-
headers- Optional Template (map[string]string)Headers to include in the request.
-
params- Optional Template (map[string]string)Query parameters to append to the request URL.
-
response_type- Optional (string)Must be one of:ResponseType is the format to parse the response as.
json,raw.
Example
Section titled “Example”steps: - id: get-users collector: api http_get: path: /users params: page: "1" limit: "10" response_type: json