JavaScript APIの呼び出し
662 ワード
let response = fetch("https://jsonplaceholder.typicode.com/posts").then(
(res) => {
console.log(res);
}
);

100 fetchでAPIを呼び出すと、APIの結果値(シェル内のキャンディ)を返すのではなく、APIの成功したオブジェクト自体が返されます.
async function getData() {
let rawresponse = await fetch("https://jsonplaceholder.typicode.com/posts");
let jsonresponse = await rawresponse.json();
console.log(jsonresponse);
}
getData();

❗(皮をむいたキャンディ)
Reference
この問題について(JavaScript APIの呼び出し), 我々は、より多くの情報をここで見つけました https://velog.io/@aloha006/자바스크립트-API-호출하기テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol