Skip to content

Commit fa8163c

Browse files
committed
Add reference to JS response object.
1 parent 9696f24 commit fa8163c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docs/user-guide/builtins.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,12 @@ else:
140140
print(response.status)
141141
```
142142

143+
The object returned from an `await fetch` call will have attributes that
144+
correspond to the
145+
[JavaScript response object](https://developer.mozilla.org/en-US/docs/Web/API/Response).
146+
This is useful for getting response codes, headers and other metadata before
147+
processing the response's data.
148+
143149
Alternatively, rather than using a double `await` (one to get the response, the
144150
other to grab the data), it's possible to chain the calls into a single
145151
`await` like this:

0 commit comments

Comments
 (0)