Stream a JSON array one element at a time
The complete body is a valid JSON array, but it arrives incrementally, which is useful for testing streaming JSON parsers. Example: curl -N "https://api.testingapis.com/api/stream/json-array/10"The complete body is a valid JSON array, but it arrives incrementally, which is useful for testing streaming JSON parsers. Example: curl -N "https://api.testingapis.com…"
Parameters 2
| Name | Type | Description |
|---|---|---|
nrequired | path · integer (int32) | Number of elements (1-1000; out-of-range values are clamped). |
intervalMs | query · integer (int32) | Delay between elements in milliseconds (0-5000, default 100). Default: 100. |
Responses
- 200
- A JSON array, streamed.
Example
Request
curl -X GET "https://api.testingapis.com/api/stream/json-array/3" \
-H "X-TestingApis-Key: YOUR_API_KEY"Response200 OK
Cache-Control: no-cache
[
{"id": 1, "name": "Alpha-001", "value": 3.14, "even": false},
{"id": 2, "name": "Bravo-002", "value": 6.28, "even": true},
{"id": 3, "name": "Charlie-003", "value": 9.42, "even": false}
]Sign in to see the details
The parameters, request and response examples and the live Try it panel for this endpoint are for signed-in members. Accounts are free and take a few seconds to create.