Skip to main content

http Command

The http command sends objects in a payload to the defined HTTP(S) endpoint.

The shape and format of the object can be adjusted with commands such as list, format, jq, etc.

tip

You can use the chunk command to send chunks of objects:

Perform up to 3 requests, where every request will contain up to 10 elements
> search is(volume) limit 30 | chunk 10 | http test.foo.org

Usage

http [--compress] [--timeout <seconds>] [--no-ssl-verify] [--no-body] [--nr-of-retries <num>] [--auth <username>:<password>] <http_method> <url> <headers> <query_params>

Parameters

ParameterDescriptionRequired?Default Value
http_methodHTTP request method (GET, PUT, POST, DELETE, or PATCH)POST
urlURL endpoint to which the request should be sent *✔️
headersHTTP request headers (e.g., HeaderA:value1 HeaderB:value2 "HeaderC:value with whitespace")
query_paramsHTTP request query parameters (e.g., param1==value2 param2==value2 "param3==value with whitespace")

* If a URL scheme is not present, it will be determined by whether or not the http command or the https command alias was used. Additionally, localhost can be omitted from url (e.g., :8080/call/me).

Options

OptionDescriptionRequired?
--compressCompress request body
--timeout <seconds>Maximum timeout in seconds (aborts request if exceeded)
--no-ssl-verifyDisable SSL certificate verification
--no-bodySend with empty request body
--nr-of-retriesMaximum number of retries for unsuccessful requests (non-2XX HTTP status codes) *
--authBasic authentication username and password

* By default, requests are retried three times. There is an exponential backoff between retries.

Aliases

  • https

Examples

Look for unencrypted volumes and report them to the specified endpoint
> search is(volume) and reported.volume_encrypted==false | https my.node.org/handle_unencrypted
​3 requests with status 200 sent.
Query all volumes and send chunks of 50 volumes per request to the specified handler
> search is(volume) | chunk 50 | https --compress my.node.org/handle
​2 requests with status 200 sent.
Same as previous, but define special header and query parameter values
> search is(volume) | chunk 50 | https my.node.org/handle "greeting:hello from fixcore" type==volume
​2 requests with status 200 sent.