javascript - I tried to request body json to node js using await fetch the body is empty - Stack Overflow

PHOTO EMBED

Tue Feb 18 2025 18:46:05 GMT+0000 (Coordinated Universal Time)

Saved by @Luciano #javascript

const req = await fetch(
    "http://localhost:3000/api/auth/signin", {
      method: "POST",
      header:{
        'Accept':'application/json',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        username:myusername,
        password:mypassword
      })
    },
    
  )
content_copyCOPY

https://stackoverflow.com/questions/69332201/i-tried-to-request-body-json-to-node-js-using-await-fetch-the-body-is-empty