[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ja/docs/Web/API/Response/json_static [Back]  [Original]

Response: json() - Web API | MDN

MDN Web Docs

View in English Always switch to English

Response: json()

Baseline

20239

json() Response JSON Content-Type application/json

JSON Response json() Response JSON json() JSON JSON

js
Response.json(data)
Response.json(data, options)

data

JSON

options

Response()

status

200

statusText

200 OK

headers

Headers HTTP

Response

TypeError

data JSON JavaScript undefined

JSON Response

JSON

Response JSON { my: "data" } application/json

js
const jsonResponse = Response.json({ my: "data" });
logResponse(jsonResponse);

200

JSON Response

status statusText JSON

Response JSON { some: "data", more: "information" } application/json 307 ("Temporary Redirect")

js
const jsonResponse = Response.json(
  { some: "data", more: "information" },
  { status: 307, statusText: "Temporary Redirect" },
);
logResponse(jsonResponse);

200 299 ok false

Fetch
# ref-for-dom-response-json


Web Proxy Viewer  |  New URL  |  Original Page