之前也没注意看,这次发现复制下来的 fetch 请求body
里面带有后斜杠\
, 这个写法没见过,请问各位老哥,这是什么?如果我把它放到postman
里去,是否要换成正常的 json 格式?
fetch("https://example.com/api/something", {
"headers": {
"accept": "application/json, text/plain, */*",
"content-type": "application/json",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin"
},
"body": "{\"key1\":\"value1\",\"key2\":\"value2\"}",
"method": "POST",
"mode": "cors",
"credentials": "include"
});
1
deplivesb 2021-11-28 14:12:36 +08:00 1
这不就是转义么?
|
5
Xusually 2021-11-28 17:20:17 +08:00 1
???
双引号转义啊 |
6
4ark 2021-11-29 00:15:16 +08:00 via iPhone 1
如果只是想导入到 postman ,可以直接复制为 curl 再导入
|