JSON formatieren
JSON mit zwei Leerzeichen einrücken, minimieren und auf Syntaxfehler prüfen.
Convert curl -X/-H/-d into fetch and axios snippets.
Läuft im Browser — Daten verlassen Ihr Gerät nicht
// 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.