cURLをコードに
無料cURLコマンドをfetch、Axios、Python、Go、PHPのコードに変換。
cURLコマンド
コード
const response = await fetch("https://api.example.com/v1/users", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_TOKEN"
},
body: JSON.stringify({
"name": "Ada",
"email": "ada@example.com"
}),
});
const data = await response.json();
console.log(data);ブラウザでローカルに処理されます — お使いのデバイスから何も送信されません。