I have used Frisby framework to write the API test cases. when I put the url and credential into postman or DHC, the responses are coming correctly but in the frisby test cases I am getting error:-
The code is below:-
var frisby = require('frisby');
frisby.create('User Authentication')
//send the params to below url
.post("url",
{ username: "username",
password: "password"
},
{ json: true,
headers: {Accept:'application/json',
'Accept-Encoding':'Encoding:gzip, deflate',
'Accept-Language':'en-US,en;q=0.8',
Connection:'keep-alive',
'Content-Length':'107',
'Content-Type':'application/json',
Host:'url.com',
Origin:'http://url.com',
Referer:'http://url.com/',
'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36',
'X-Application-Key':'1234545',
'X-Requested-With':'XMLHttpRequest'
}
}
)
.expectStatus(200)
.toss();