- From: Alex Frazer <notifications@github.com>
- Date: Fri, 13 Jan 2017 06:45:12 -0800
- To: whatwg/fetch <fetch@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Friday, 13 January 2017 14:45:51 UTC
So, on a 204, if you use `.json` on the response, it will throw an error:
```
export async function deleteUser(id: string) {
const response = await fetch('/users', { method: 'DELETE' });
console.log(response.status) // 204
return response.json(); // shouldn't it return {}?
}
```
Instead, it says it can't parse the json.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/453
Received on Friday, 13 January 2017 14:45:51 UTC