> Agent-readable docs index: /llms.txt. Download /docs.zip to grep all markdown files locally.

---
title: network
description: HTTP GET and POST request utilities
icon: wifi
---

The `network` namespace sends HTTP requests to remote URLs.

## get

```lua
network.get(url: string[, headers: table, callback: function]): string
```

> Sends a GET request to the URL.

<Schema title="Parameters">
  <SchemaField name="url" type="string" required>
    URL.
  </SchemaField>

  <SchemaField name="headers" type="table">
    Optional. Headers.
  </SchemaField>

  <SchemaField name="callback" type="function">
    Optional. Callback.
  </SchemaField>
</Schema>

<Schema title="Returns">
  <SchemaField name="response" type="string">
    The response body of the request.
  </SchemaField>
</Schema>

## post

```lua
network.post(url: string[, data: table, headers: table, callback: function]): string
```

> Sends a POST request to the URL.

<Schema title="Parameters">
  <SchemaField name="url" type="string" required>
    URL.
  </SchemaField>

  <SchemaField name="data" type="table">
    Optional. Post data.
  </SchemaField>

  <SchemaField name="headers" type="table">
    Optional. Headers.
  </SchemaField>

  <SchemaField name="callback" type="function">
    Optional. Callback.
  </SchemaField>
</Schema>

<Schema title="Returns">
  <SchemaField name="response" type="string">
    The response body of the request.
  </SchemaField>
</Schema>
