---
title: Send data over HTTP
project: OpenSync
version: 1.0
section: reference
language: en
license: MIT
url: https://totaljs.es/docs/opensync/1-0/reference/send-http/
updated: 2026-11-19T09:22:09.965Z
---

# Send data over HTTP

> Send a request to /sync/{channel}/ to deliver its data to the clients of that channel.

```text
GET    /sync/{channel}/
POST   /sync/{channel}/
PUT    /sync/{channel}/
PATCH  /sync/{channel}/
DELETE /sync/{channel}/
```

Send any of these requests, and OpenSync delivers it as a [message](../message-format/) to every client that can read `{channel}`. Pick any channel name, for example `orders`, `stock` or `Orders-EU_2`; channels do not need to be created first.

OpenSync answers `200` with an empty body, also when no client is connected. Sending needs no token. See [Run in production](../../guides/production/) to decide who can reach this address.

## JSON

```bash
curl -X POST -H "Content-Type: application/json" -d '{"id":1002,"status":"paid"}' "https://sync.example.com/sync/orders/"
```

The clients receive the JSON as an object in `body`:

```json
{"id":"24nb4004pu50d","type":"application/json","channel":"orders","method":"POST","headers":{"host":"sync.example.com","user-agent":"curl/8.7.1","accept":"*/*","content-type":"application/json","content-length":"27"},"ua":"","query":{},"body":{"id":1002,"status":"paid"},"ts":"2026-11-19T08:04:51.361Z","ip":"203.0.113.10","files":[]}
```

## Form data

```bash
curl -X PUT -H "Content-Type: application/x-www-form-urlencoded" -d "sku=A-100&qty=7" "https://sync.example.com/sync/stock/"
```

The fields arrive as an object of strings: `"body":{"sku":"A-100","qty":"7"}`.

## Plain text and other types

Any other content type arrives as text. A `PATCH` with `Content-Type: text/plain` and the body `hello` arrives as `"type":"text/plain"` and `"body":"hello"`.

## Query arguments only

```bash
curl "https://sync.example.com/sync/orders/?id=1001&status=paid"
curl -X DELETE "https://sync.example.com/sync/orders/?id=1001"
```

The arguments arrive in `query`, for example `"query":{"id":"1001","status":"paid"}`, and `body` is an empty string.

## Files

Send files as `multipart/form-data` with `POST` or `PUT`. See [Send files](../files/).

## Requests that are not delivered

| Request | Answer |
|---|---|
| Another method, for example `OPTIONS` | `404` |
| A deeper path, for example `/sync/a/b/` | `404` |
| A file upload larger than about 2 MB | `431` |

See [Status codes and limits](../status-codes/).
