Formater du JSON
Indentez avec deux espaces, compactez le JSON et vérifiez sa syntaxe.
Convert curl -X/-H/-d into fetch and axios snippets.
S'exécute dans votre navigateur — les données ne quittent pas votre appareil
// 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.