Here’s my code:
Blockquote
var params = {
"otp": payTmOTPval.otp,
"state": payTmOTPval.state
};
var headers = {
contentType: 'application/json',
Authorization: 'Basic ' + clientidsecretbase64
}
app.request({
method: 'POST',
url: `${payTMUrl}signin/validate/otp`,
headers: headers,
params: JSON.stringify(params),
success: function(data) {
console.log(data)
},
error: function(err) {
console.log(err)
}
})
Blockquote
The problem here is, when I submit it it auto attach “application/x-www-form-urlencoded” in the header and the reason my request fails. I want data to not go as params but as body raw JSON(application/json) and header shouldn’t not auto include “application/x-www-form-urlencoded”.
kindly help me