Re: [whatwg/fetch] static method: `Response.html`? (Issue #1865)

noamr left a comment (whatwg/fetch#1865)

> That doesn't strike me as very useful.

It's not necessarily "very" useful but rather a common pattern.
See thread at https://x.com/kettanaito/status/1975208665419481575
and specifically existing userland implementation of this at MSW: https://github.com/mswjs/msw/blob/94651f5553f74b5cb2f15a230b82dc94499f34b1/src/core/HttpResponse.ts#L142

All in all I think its usefulness vs. complexity tradeoff is not too bad.

> I also don't think we want to end up with a long list of static methods for all the different MIME types.
Not sure how many mime-types people generate in a service worker directly in practice as responses.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/1865#issuecomment-3372068159
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/fetch/issues/1865/3372068159@github.com>

Received on Monday, 6 October 2025 14:44:48 UTC