0

您好,我在删除 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()
4

1 回答 1

0

500 表示内部服务器错误。这意味着您的 REST 调用破坏了服务器中的某些内容。请检查服务器日志以查看真正的问题。为此,服务器端可能存在一些问题。

于 2017-05-03T20:10:10.390 回答