response := network_request(Args{method: "GET", url: "https://api.example.com/data"})
send_text_message(Args{
channel_id: trigger.channel_id,
message_content: "Status Code: " + response.status_code,
})
Inputs
MethodRequired
HTTP method to use.
OptionsGETPOSTPUTPATCHDELETEHEADOPTIONS
URLRequired
Target URL (must be public http/https).
Example: https://api.example.com/data
Request Body
Raw request body string.
Headers
Request headers, newline separated (X=Y).
Example: Authorization=Bearer token Content-Type=application/json
Cookies
Cookies, newline separated (X=Y).
Example: session=abc123 mode=dark
Outputs
Status Code
HTTP response status code.
Example: 200
Response Body
Response body text.
Response Headers
Response headers as newline-separated key=value pairs.
Response Time (ms)
Request duration in milliseconds.
Example: 123
Build a bot using blocks like Network Request
Use this block in our visual flow editor. Bots are hosted 24/7 for free on inventor.bot.
Advanced Documentation
This documentation can be useful when using code mode. View as Markdown
ID:
network_requestInputs
| Field | InventScript name | Value |
|---|---|---|
| Method | method | "GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS" |
| URL | url | e.g. "https://api.example.com/data" |
| Request Body | request_body | |
| Headers | headers | e.g. "Authorization=Bearer token\nContent-Type=application/json" |
| Cookies | cookies | e.g. "session=abc123\nmode=dark" |
Outputs
| Field | InventScript name | Value |
|---|---|---|
| Status Code | status_code | e.g. "200" |
| Response Body | response_body | |
| Response Headers | response_headers | |
| Response Time (ms) | response_time_ms | e.g. "123" |
Example InventScript
More network blocks
Escape JSON FieldEscape a string to be used as a JSON field.Parse JSONRetrieve a value from a JSON string.Format JSONIndent a JSON string for readability.Generate Form BodyGenerate a HTTP form body from a list of key-value pairs.Respond to Incoming WebhookRespond to an incoming webhook request with a custom status code and response body.