I have a code in zapier:
var username = "username"
var password = "password"
var grant_type = "password"
var client_id = "id"
var ENDPOINT="someUrl"
var json = {
      "grant_type": grant_type,
      "username": username,
      "password": password,
      "client_id": client_id
};
var options={
  method:"POST",
  headers: {
   'Accept': 'application/json',
   'Content-Type': 'application/json'
  },
  payload:json
}
const result = await fetch(WAVITY_ENDPOINT,options)
const content = await result.json()
output={response:content}
But I am always getting Unauthorized error. I do the same through request module and it works. I think fetch is not sending the data. Any help would be appreciated.In my request module code, I have following options:
headers: {
        connection: "Keep-Alive",
        timeout: 5000
      },
      url: ENDPOINT,
      method: 'POST',
      formData: {
        'grant_type': grant_type,
        'username': username,
        'password': password,
        'client_id': client_id
      }
NOTE: Changing the headers of fetch to headers like in request also does not work for me.
 
    