Re: [whatwg/fetch] Add `Response.json` static method (PR #1392)

@lucacasonato commented on this pull request.



> +<p>The static
+<dfn method for=Response><code>json(<var>data</var>, <var>init</var>)</code></dfn> method steps
+are:
+
+<ol>
+ <li><p>Let <var>bytes</var> the result of running <a>serialize a JavaScript value to JSON bytes</a>
+ on <var>data</var>.
+
+ <li><p>Let <var>body</var> be the result of <a for=BodyInit>extracting</a> <var>bytes</var>.
+
+ <li><p>Let <var>responseObject</var> be the result of <a for=Response>creating</a> a {{Response}}
+ object, given a new <a for=/>response</a>, "<code>response</code>", and <a>this</a>'s
+ <a>relevant Realm</a>.
+
+ <li><p>Perform <a>initialize a response</a> given <var>responseObject</var>, <var>init</var>, and
+ (body, <code>"application/json;charset=UTF-8"</code>).

Removed charset.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/pull/1392#discussion_r871296841
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/fetch/pull/1392/review/970731664@github.com>

Received on Thursday, 12 May 2022 12:05:49 UTC