Skip to content

@http:fetch

Fetch a URL and return the response body as a string.

Returns: string

@http:fetch(url method? body? auth?)
Name Type Description
url string Request URL
[method] string HTTP method (GET, POST, etc.)
[body] string Request body (JSON string)
[auth] string Authorization header value
# Simple GET request
set $response @fetch("https://test.evmcrispr.local/hello")
print $response
# POST with a body
set $response @fetch("https://test.evmcrispr.local/echo" POST "payload")
print $response