Answer the question
In order to leave comments, you need to log in
How to write a POST request with JSON and authorization in JavaScript?
Good afternoon!
Tell me how to write a POST request in JavaScript?
Initial data:
Answer the question
In order to leave comments, you need to log in
For example like this
fetch(YOUR_URL, {
method: 'POST',
headers: {
'Client-Id': YOUR_CLIENT_ID,
'Api-Key': YOUR_API_KEY,
'Content-Type': 'application/json'
},
body: JSON.stringify({
offer_id: YOUR_OFFER_ID,
product_id: YOUR_PRODUCT_ID,
sku: YOUR_SKU
})
}).then(response => response.json()).then(data => {
console.log(data);
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question