json( )


Reads the response body as JSON.

The json() function reads the body response stream to its completion and parses it as JSON. It returns a Promise that resolves to the response body as a JSON object.

Method Declaration
Copy
function json(): Promise<object>;
Request
This method does not take any parameters
Returns
Return Type:Promise<object>
JavaScript
let json = response.json(); // {"key": "some value"}
Did this help?