---
title: "HttpPost"
description: "Performs a POST on a worker and resumes the calling thread with a body string."
---

```lua
HttpPost(url: string, body: string? = ""): string
```

---

## Aliases

None.

---

## Arguments

<ParamField body="url" type="string" required>
  The endpoint URL, including its protocol.
</ParamField>

<ParamField body="body" type="string" default={"\"\""}>
  The request body.
</ParamField>

---

## Returns

<ResponseField name="body" type="string">
  The response body, or a Luau comment string describing the failure.
</ResponseField>

Requires a local echo server for this example. Uses application/x-www-form-urlencoded. Failure returns a Luau comment string. Receiver-style argument parsing can choose the URL as the body; prefer the global form or request.

**Related types:** [HTTP types & behavior](/reference/http/types).

---

## Example

```lua
print(HttpPost("http://127.0.0.1:8080/echo", "message=hello"))
```
