send_request
Sends a request and returns its response.
Overview
send_request sends a saved request or draft as the Send button does: pre-request scripts, variables and auth, then post-response scripts. The result is recorded in History and shown in Relay. It's real network traffic and can change data on a server, so check how your agent asks before it uses this tool.
Secret values in the response appear as [redacted]. The body is capped at 16,000 characters. A binary or very large body is left out, with bodyOmitted saying why. An event stream is stopped after maxStreamSeconds, and its last events are returned in stream.
WebSocket requests can't be sent. A request already being sent is refused.
{
"requestId": "5B2C8E41-9D3A-4F67-B0E8-1A4C7D2F6E95"
}Parameters
Prop
Type
Return Value
{
"status": 200,
"statusText": "OK",
"timeMs": 182,
"size": 18,
"contentType": "application/json",
"url": "https://api.example.com/v1/orders",
"headers": [
{ "key": "Content-Type", "value": "application/json" }
],
"body": "{\"orders\":[]}",
"scripts": {
"passed": 1,
"failed": 0,
"skipped": 0,
"failures": [],
"logs": [],
"errors": [],
"notices": []
}
}missingVariables lists any {{variables}} that didn't resolve. A send that couldn't complete is an error result with the reason.
See Also
- get_request: Reads a request or draft as written, with its secrets hidden.
- update_request: Changes a request or draft.