Create Merge Request REST API returns `Bad Request` with JavaScript's `fetch`, but succeed in POSTMAN

Hi, I’m trying to use Node.js to create a Merge Request using fetch API.

However, I always receive Bad Request no matter what I try, and it also fails with browser’s fetch. But sending the request in POSTMAN is succeed.

Wondering whether I did something wrong or is it a bug?

fetch(
  `https://gitlab.com/api/v4/projects/*********/merge_requests`,
  {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'PRIVATE-TOKEN': '*****-********************'
    },
    body: {
      'source_branch': 'development',
      'target_branch': 'staging',
      title: 'Development to Staging',
      description: 'Development to Staging',
    }
  }
)
  .then(res => res.text())
  .then(body => {
    try {
      body = JSON.parse(body)
    } catch (err) {}

    if (typeof body !== 'object') {
      console.error('Failed to create merge request: ', body)
      process.exit(1)
    }

    if ('web_url' in body) {
      console.log('Created merge request: ', body.web_url)
      process.exit(0)
    } else {
      console.error('Failed to create merge request: ', body)
      process.exit(1)
    }
  })
  .catch(err => {
    console.error('Failed to create merge request: ', err)
    process.exit(1)
  })

Result:

Node.js:

Browser:

However, in POSTMAN, it succeed: