HTTP Library
CLI HTTP library ("HTTP").
Last updated
Was this helpful?
CLI HTTP library ("HTTP").
Last updated
Was this helpful?
The that the CLI uses is separate from Stof. It is required that you to add this library when invoking the CLI. Otherwise, the CLI will not add it and you will not have network access while running your Stof document.
HTTP GET request.
The URL argument is required, but everything else is optional. You may skip providing arguments that you do not need. For example "HTTP.get(url, timeout)" would be acceptable. However, if you need all arguments, they are required to be in this order.
The request header map must have string keys and string values (if provided).
Timeout defaults to 5 seconds, but you may use as needed.
If a response object is provided, Stof will use the it has access to and the Content-Type header in the response headers to parse the response body into the provided object.
The return type is a tuple, giving you easy access to the response content type, headers, and body. You can then use these to the body into the document, or further orchestrate additional requests.
HTTP POST request. Identical in implementation to , but uses the POST request method.
HTTP PUT request. Identical in implementation to , but uses the PUT request method.
HTTP DELETE request. Identical in implementation to , but uses the DELETE request method.
HTTP PATCH request. Identical in implementation to , but uses the PATCH request method.
HTTP HEAD request. Identical in implementation to , but uses the HEAD request method.