JSON 格式化
以两个空格缩进排版 JSON,压缩为单行并检查语法。
Convert curl -X/-H/-d into fetch and axios snippets.
在浏览器内运行 — 数据不会离开您的设备
// fetch
fetch('https://api.example.com/v1/items', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer token'
},
body: '{"name":"toco.tools"}'
})
// axios
axios({
method: 'post',
url: 'https://api.example.com/v1/items',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer token'
},
data: '{"name":"toco.tools"}'
})Yes.
No.