WEB-12
curl to fetch Converter
Convert a curl command into JavaScript fetch() code.
fetch("https://api.example.com/users", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: {"name":"John"},
});Convert a curl command into JavaScript fetch() code.
fetch("https://api.example.com/users", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: {"name":"John"},
});