Unable to use DELETE method with pub.client:http to invoke a RESTFul DELETE service

Hi,

I am trying to do invoke a REST service of type DELETE from another flow service where I use a pub.client:http method to send the request string.

Issue: The called service does not have any data in the pipeline. I even tried by sending the data as stream. I tried the tracepipeline service in the called service and noticed that no input data is present.

[1666]2015-12-30 09:50:47 EST [ISP.0090.0002C] — END tracePipeline —
[1665]2015-12-30 09:50:47 EST [ISP.0090.0008C] 3 remotePort {java.lang.String} = ‘60999’
[1664]2015-12-30 09:50:47 EST [ISP.0090.0008C] 3 remoteIp {java.lang.String} = ‘10.145.122.172’
[1663]2015-12-30 09:50:47 EST [ISP.0090.0008C] 3 localPort {java.lang.String} = ‘8700’
[1662]2015-12-30 09:50:47 EST [ISP.0090.0008C] 3 localIp {java.lang.String} = ‘157.184.59.21’
[1661]2015-12-30 09:50:47 EST [ISP.0090.0008C] 2 ipInfo {com.wm.util.Values} =>
[1660]2015-12-30 09:50:47 EST [ISP.0090.0008C] 3 Content-Type {java.lang.String} = ‘application/json; charset=UTF-8’
[1659]2015-12-30 09:50:47 EST [ISP.0090.0008C] 3 Authorization {java.lang.String} = ‘Basic UkVTVFVzZXI6UkVTVFVzZXI=’
[1658]2015-12-30 09:50:47 EST [ISP.0090.0008C] 3 Host {java.lang.String} = ‘dashrwmis002.lex.lexmark.com:8700
[1657]2015-12-30 09:50:47 EST [ISP.0090.0008C] 3 Accept {java.lang.String} = ‘image/gif, /
[1656]2015-12-30 09:50:47 EST [ISP.0090.0008C] 3 User-Agent {java.lang.String} = ‘Mozilla/4.0 [en] (WinNT; I)’
[1655]2015-12-30 09:50:47 EST [ISP.0090.0008C] 2 requestHdrs {com.wm.util.Values} =>
[1654]2015-12-30 09:50:47 EST [ISP.0090.0008C] 2 method {java.lang.String} = ‘DELETE’
[1653]2015-12-30 09:50:47 EST [ISP.0090.0008C] 2 requestUrl {java.lang.String} = ‘/rest/asset/deleteBookmarkedAsset’
[1652]2015-12-30 09:50:47 EST [ISP.0090.0008C] 1 http {com.wm.util.Values} =>
[1651]2015-12-30 09:50:47 EST [ISP.0090.0008C] 1 subprotocol {java.lang.String} = ‘HTTP’
[1650]2015-12-30 09:50:47 EST [ISP.0090.0008C] 1 protocol {java.lang.String} = ‘http’
[1649]2015-12-30 09:50:47 EST [ISP.0090.0008C] 0 transport {com.wm.util.Values} =>
[1648]2015-12-30 09:50:47 EST [ISP.0090.0001C] — START tracePipeline [12/30/15 9:50 AM] —

Please help me solve the issue. Does pub.client:http not allow the DELETE method?

Hi,

Have you tried supplying data trough URL like GET ?

Below post explains well with example

Yes, like Bari mentioned, you have to use query params to pass your data while using DELETE verb. Integration server ignores any data that is sent as a body as it is against the philosophy of DELETE verb. Only POST and PUT are supposed to get data as a body.

The HTTP/1.1 Semantics and Content specification (https://tools.ietf.org/html/rfc7231#section-4.3.5) says

A payload within a DELETE request message has no defined semantics;
sending a payload body on a DELETE request might cause some existing
implementations to reject the request.

That said, there are HTTP servers out there that expect a request entity with DELETE. Recent fixes to Integration Server versions 9.9 and higher include the ability to send a payload with DELETE requests made with the pub.client:http service. Supply your payload in the data/bytes input variable and it will be sent as the request entity with your DELETE request.