# Network Request

> Send an HTTP request and return the response.

- ID: `network_request`
- Type: Block
- Category: [Network](https://inventor.bot/docs/reference/blocks/network.md)

**Inputs**

| Name | Required | Description | Value |
| --- | --- | --- | --- |
| `method` | yes | HTTP method to use. | `"GET"`, `"POST"`, `"PUT"`, `"PATCH"`, `"DELETE"`, `"HEAD"`, `"OPTIONS"` |
| `url` | yes | Target URL (must be public http/https). | e.g. `"https://api.example.com/data"` |
| `request_body` |  | Raw request body string. |  |
| `headers` |  | Request headers, newline separated (X=Y). | e.g. `"Authorization=Bearer token\nContent-Type=application/json"` |
| `cookies` |  | Cookies, newline separated (X=Y). | e.g. `"session=abc123\nmode=dark"` |

**Outputs**

| Name | Description | Value |
| --- | --- | --- |
| `status_code` | HTTP response status code. | e.g. `"200"` |
| `response_body` | Response body text. |  |
| `response_headers` | Response headers as newline-separated key=value pairs. |  |
| `response_time_ms` | Request duration in milliseconds. | e.g. `"123"` |

**Example**

```go
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,
})
```