Response 객체 메소드
Response.ok
The ok
read-only property of the Response
interface contains a Boolean stating whether the response was successful (status in the range 200-299) or not.
Value
A boolean value.
Response.json()
The json()
method of the Response
interface takes a Response
stream and reads it to completion. It returns a promise which resolves with the result of parsing the body text as JSON
.
Note that despite the method being named json()
, the result is not JSON but is instead the result of taking JSON as input and parsing it to produce a JavaScript object.
JSON이 아니라, JSON을 input으로 받아서 javascript object를 output하는 메소드이다.
Syntax
response.json().then(data => {
// do something with your data
});
Copy to Clipboard
Parameters
None.
Return value
A Promise
that resolves to a JavaScript object. This object could be anything that can be represented by JSON — an object, an array, a string, a number...
Author And Source
이 문제에 관하여(Response 객체 메소드), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://velog.io/@hqillz/Response-객체-메소드저자 귀속: 원작자 정보가 원작자 URL에 포함되어 있으며 저작권은 원작자 소유입니다.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)