File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ if (response.ok) { // 如果 HTTP 状态码为 200-299
6262` Response ` 提供了多种基于 promise 的方法,来以不同的格式访问 body:
6363
6464- ** ` response.text() ` ** —— 读取 response,并以文本形式返回 response,
65- - ** ` response.json() ` ** —— 将 response 解析为 JSON,
65+ - ** ` response.json() ` ** —— 将 response 解析为 JSON 格式 ,
6666- ** ` response.formData() ` ** —— 以 ` FormData ` 对象(在 [ 下一章] ( info:formdata ) 有解释)的形式返回 response,
6767- ** ` response.blob() ` ** —— 以 [ Blob] ( info:blob ) (具有类型的二进制数据)形式返回 response,
6868- ** ` response.arrayBuffer() ` ** —— 以 [ ArrayBuffer] ( info:arraybuffer-binary-arrays ) (低级别的二进制数据)形式返回 response,
@@ -75,7 +75,7 @@ let url = 'https://api.github.com/repos/javascript-tutorial/en.javascript.info/c
7575let response = await fetch (url);
7676
7777* ! *
78- let commits = await response .json (); // 读取 response body,并将其解析为 JSON
78+ let commits = await response .json (); // 读取 response body,并将其解析为 JSON 格式
7979*/ ! *
8080
8181alert (commits[0 ].author .login );
You can’t perform that action at this time.
0 commit comments