具有DELETE方法的Worklight

具有DELETE方法的Worklight

本文介绍了具有DELETE方法的Worklight WL.Server.invokeHttp()不接受查询参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Worklight适配器,它通过WL.Server.invokeHttp()调用RESTful方法.使用http DELETE方法时,不会添加查询字符串参数.我使用的是Worklight 6.0.

输入的设置如下:

{
   "headers": {
      "Accept": "application\/json",
      "Authorization": "Bearer xxxxxxxxxxxxxxxx",
      "Content-Type": "application\/json"
   },
   "method": "delete",
   "parameters": {
      "messageIds": "r11118,r11119"
   },
   "path": "\/myMessages\/v2\/messages"
}

and called like: var result=WL.Server.invokeHttp(input);

但是我可以从 Wireshark 中看到,没有添加查询参数:

  DELETE /myMessages/v2/messages HTTP/1.1\r\n

如果我要做的就是将方法更改为GET,则Wireshark上存在这些参数:

  GET /myMessages/v2/messages?messageIds=r11118%2Cr11119 HTTP/1.1\r\n
解决方案

听起来像个bug.我们将对其进行调查,并在得到确认的下个版本中对其进行修复.

I have a Worklight adapter that calls a RESTful method through WL.Server.invokeHttp(). When an http DELETE method is used, the query string parameters do not get added. I'm on Worklight 6.0.

The input is setup like so:

{
   "headers": {
      "Accept": "application\/json",
      "Authorization": "Bearer xxxxxxxxxxxxxxxx",
      "Content-Type": "application\/json"
   },
   "method": "delete",
   "parameters": {
      "messageIds": "r11118,r11119"
   },
   "path": "\/myMessages\/v2\/messages"
}

and called like: var result=WL.Server.invokeHttp(input);

But I can see from Wireshark that the query params don't get added:

  DELETE /myMessages/v2/messages HTTP/1.1\r\n

If all I do is change the method to a GET, the params are there on Wireshark:

  GET /myMessages/v2/messages?messageIds=r11118%2Cr11119 HTTP/1.1\r\n
解决方案

Sounds like a bug. We'll investigate it and fix in next releases if confirmed.

这篇关于具有DELETE方法的Worklight WL.Server.invokeHttp()不接受查询参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 17:29