Worklight adapter invoke Http DELETE Method not working

277 views Asked by At

Refer this link. Worklight WL.Server.invokeHttp() with DELETE method doesn't accept query param I am adding content in body ,but i am getting 500 response.Same request is working from postman and other clients.I think this is an issue with worklight.

My request :

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}

Implementation Code:

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);
1

There are 1 answers

0
Darrel Miller On

The HTTP DELETE method is not allowed to use any content provided in the body. Therefore it is not surprising that the server would return an error. Technically, the response should be a 400, not a 500.