Skip to content

Commit be960d7

Browse files
committed
Improved http options
1 parent 09b61c2 commit be960d7

File tree

1 file changed

+14
-5
lines changed
  • src/content/docs/pipelines/build-with-pipelines

1 file changed

+14
-5
lines changed

src/content/docs/pipelines/build-with-pipelines/http.mdx

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,19 @@ $ npx wrangler pipelines create [PIPELINE-NAME] --r2-bucket [R2-BUCKET-NAME]
2020
✅ Successfully created pipeline [PIPELINE-NAME] with ID [PIPELINE-ID]
2121

2222
You can now send data to your pipeline with:
23-
curl "https://<PIPELINE-ID>.pipelines.cloudflare.com/" -d '[{ ...JSON_DATA... }]'
23+
curl "https://<PIPELINE-ID>.pipelines.cloudflare.com/" -d '[{ "foo":"bar" }]'
24+
```
25+
26+
## Accepted data formats
27+
Pipelines accept arrays of valid JSON objects. You can send multiple objects in a single request, provided the total data volume is within the [documented limits](/pipelines/platform/limits). Sending data in a different format will result in an error.
28+
29+
For example, you can send data to your pipeline using a curl command like this:
30+
```sh
31+
curl -X POST https://<PIPELINE-ID>.pipelines.cloudflare.com \
32+
-H "Content-Type: application/json" \
33+
-d '[{"foo":"bar"}, {"foo":"bar"}, {"foo":"bar"}]'
34+
35+
{"success":true,"result":{"committed":3}}
2436
```
2537

2638
## Turning HTTP ingestion off
@@ -54,10 +66,7 @@ Include the API token you created in the previous step in the headers for your r
5466
curl https://<PIPELINE-ID>.pipelines.cloudflare.com
5567
-H "Content-Type: application/json" \
5668
-H "Authorization: Bearer ${API_TOKEN}" \
57-
-d '[
58-
{"key1": "value1", "key2": "value2"},
59-
{"key1": "value3", "key2": "value4"}
60-
]'
69+
-d '[{"foo":"bar"}, {"foo":"bar"}, {"foo":"bar"}]'
6170
```
6271

6372
## Specifying CORS Settings

0 commit comments

Comments
 (0)