You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The conventions in the Fetch API is that you make a request, then do something
with the body:
```javascript
const response = await fetch('...')
const data = await response.json()
```
It doesn't do things like:
```javascript
const data = await fetch.json('...') // what method would this use?
```
This PR brings our API more inline with Fetch so where we used to do:
```javascript
for await (const datum of http.ndjson('...')) { // what method does this use?
}
```
We now do the more idiomatic:
```javascript
const response = await http.post('...')
for await (const datum of response.ndjson()) {
}
```
It also removes the `.iterator` and `.stream` methods as they do not
follow the Fetch pattern either though they can be added to the response
object if they are useful.
0 commit comments