Skip to Content

DELETE Call to REST API always gets 'Invalid Content Type'

Hi experts,

I have an iFlow that calls a REST API - and it has the same endpoint for both POST and DELETE. I'm making the call using HTTP receiver adapters.

So the POST is working fine. However, the DELETE isn't. I always get the response from the API that says 'Invalid Content Type'. I've tried different ways to set the Content-Type:

(1) Content Modifier - Create / Content-Type / Constant / java.lang.String / application/json

(2) Script - message.setHeader("Content-Type", "application/json)

But nothing seems to work. I've also tried sending the resource to be deleted as Query parameter instead of body and I still get the same error.

This DELETE operation is working fine when I call the API using SoapUI and Postman. Which makes me believe that the issue is in HCI.

Has anyone experienced this before? Are there other ways to set the Content-Type?

Appreciate any comments. Thanks

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Feb 26, 2017 at 02:49 PM

    Hello Mark,

    Could you please share more details about input details you are sending.

    I have tried myself deleting an entry for custom rest entity and its working fine.

    And in content modifier I have not set anything except the property value.


    Sriprasad Shivaram Bhat

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Sriprasad,

      Just want to let you know that I've raised this issue to SAP and they came back to me with the following:

      "The HTTP receiver adapter currently removes the body for DELETE, HEAD, TRACE and GET requests, because some http servers have problems processing these requests when the body is sent with the request. Normally the http servers ignore the body for such requests, but as some have issues we decided to not sent the body at all.We see this as an enhancement request to add an option to also send the body for these methods (except TRACE, where it is explicitly forbidden). This extension will come as new adapter version with one of the next updates. For now you could workaround this doing the HTTP call from a groovy script."

  • Mar 09, 2017 at 04:54 PM

    thanks mark for valuable information..!


    Sriprasad Shivaram Bhat

    Add comment
    10|10000 characters needed characters exceeded