SuperSimpleDev / javascript-course

708 stars 568 forks source link

Lesson 18 (Backend Documentation) #141

Open sudarshan-magar7 opened 4 weeks ago

sudarshan-magar7 commented 4 weeks ago

Hey Dev, When I try to place order on Checkout page then it show the error in console (400 Bad Request) for this API =https://supersimplebackend.dev/orders ,can you provide solution for this.. document.querySelector('.js-place-order').addEventListener('click', async ()=>{ const response=await fetch('https://supersimplebackend.dev/orders',{ method:'POST', headers:{ 'Content-Type':'application/json' }, body: JSON.stringify({ cart: cart }) }); const order= await response.json(); console.log(order); }); Lesson 18 Error

****