Skip to content

Commit c0b199a

Browse files
committed
Add JSON streaming example HTTP message to README
1 parent 75c0d09 commit c0b199a

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,18 @@ $client->imagePush();
151151

152152
What this means is that these endpoints actually emit any number of progress
153153
events (individual JSON objects).
154+
At the HTTP level, a common response message could look like this:
155+
156+
```
157+
HTTP/1.1 200 OK
158+
Content-Type: application/json
159+
160+
{"status":"loading","current":1,"total":10}
161+
{"status":"loading","current":2,"total":10}
162+
163+
{"status":"loading","current":10,"total":10}
164+
{"status":"done","total":10}
165+
```
154166

155167
The user-facing API hides this fact by resolving with an array of all individual
156168
progress events once the stream ends:

0 commit comments

Comments
 (0)