请参阅此链接。 Worklight WL.Server.invokeHttp() with DELETE method doesn't accept query param 我正在添加内容,但我得到500响应。来自邮递员和其他客户的请求。我认为这是工作灯的问题。
我的要求:
HEADERS
Accept: xxxx
Accept-Encoding: gzip, deflate
Consumer: xxx
Content-Length: 199
Content-Type: application/x-www-form-urlencoded
Contract: x
Cookie: xxxxx
User-Agent: runscope/0.1
PARAMETERS
list: {xxx:xxxx}
BODY view formatted
list= {xxx:xxx}
实施守则:
var input = {
method : 'delete',
returnedContentType : 'xml',
path : 'xxx'
headers : {
Accept : 'xxx',
Consumer : 'xxx',
Contract : 'x',
Cookie : xxx,
contentType : 'application/x-www-form-urlencoded'
},
body : {
contentType : 'application/x-www-form-urlencoded',
content : 'list={"one": "two","key": "value"}'
}
};
var response = WL.Server.invokeHttp(input);
答案 0 :(得分:1)
不允许HTTP DELETE方法使用正文中提供的任何内容。因此,服务器返回错误并不奇怪。从技术上讲,响应应该是400,而不是500。