将500错误输入frisby删除请求

时间:2016-11-28 05:46:28

标签: jasmine frisby.js

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

1 个答案:

答案 0 :(得分:0)

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