您好,我在删除 frisby 请求期间遇到 500 错误。代码如下,如果我做错了请纠正我..!
var frisby = require('frisby');
//get the current UTC time from this URL: (https://currentmillis.com/)
var now = new Date();
var now_utc = new Date(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), now.getUTCHours(), now.getUTCMinutes(), now.getUTCSeconds())
var currentUTCTime = now_utc.getTime() - (now_utc.getTimezoneOffset() * 60000);
frisby.create('Authentication for Delete Request Valid User Name and Password')
.delete('http://example.com',
{
headers:
{
'Accept':'application/json',
'Auth-Username':'abcd',
'X-Application-Key':'xyzzzz',
'Content-Type':'application/json',
'x-locale':'en_US',
'x-microtime':currentUTCTime, //get the current UTC time
'auth-signature': 'example', // Added new auth-signature for new responses
}
}
)
.expectStatus(200)
.toss()