Re: [whatwg/fetch] Proposal: `Response.json` helper (Issue #1389)

Following, to replace the code [here](https://github.com/opennetwork/environment/blob/ad60cde382acdfa8120e8f11db2be50a9d65aa9e/src/example/fetch.ts#L41-L51)

The current minimum:

```typescript
    respondWith(
        new Response(JSON.stringify({
            data: "value!"
        }), {
            headers: {
                "Content-Type": "application/json"
            }
        })
    )
```

This would reduce the code to:

```typescript
    respondWith(
        Response.json({
            data: "value!"
        })
    )
```

Looks great 👍🏻 

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/1389#issuecomment-1024726318

You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/fetch/issues/1389/1024726318@github.com>

Received on Friday, 28 January 2022 22:58:54 UTC