Forum Stats

  • 3,839,693 Users
  • 2,262,529 Discussions
  • 7,901,042 Comments

Discussions

400 bad request DELETE handler application/json request with empty body

Hi

We're in the middle of integrating with a 3rd party's API. One of the their calls expects us to set up a DELETE handler that accepts a paramater in the header but has no body. They are setting the content-type as application/json. It appears that in these circumstances ORDS is failing the calls with "Expected one of: <<{,[>> but got: <<EOF>>". It's expecting at least a {} in the body but getting nothing. There's a link to a very similar post below.

Is this a restriction / issue with ORDS or should the vendor not be setting the header to "application/json" if no body is passed through. I'm being told that they cannot change as many other clients use the API suite so we're at a bit on an impasse. We're on ORDS 20.2

Any advice, workarounds would be appreciated

Thanks

Simon



Tagged:

Answers

  • thatJeffSmith-Oracle
    thatJeffSmith-Oracle Distinguished Product Manager Posts: 8,705 Employee

    if you tell us to expect a json doc on the body of the request and then you don't send one, it's going to cause a problem

    if you're doing a delete, there's no need to provide a content-type on your request

    You're version of ORDS is almost 2 years old now, I'd try 21.4, but I would probably expect the same behavior.

  • Simon Collins
    Simon Collins Member Posts: 129 Bronze Badge

    Hi Jeff

    Thanks for the reply. The problem is it's not our API. It's someone else's (a very large hotel company). They are supplying the content_type in the DELETE request and they say they can't change their API for us ...

    I'll get back to them - I might try if the latest version of ORDS if all else fails

    Thanks

    Simon

  • thatJeffSmith-Oracle
    thatJeffSmith-Oracle Distinguished Product Manager Posts: 8,705 Employee

    File a Bug...in the meantime ask if they can amend the request to include an empty json doc in their DELETE requests.


    Saying you can't change something is disingenuous - you don't too <> you can't. The very large hotel company should also be engaged to see what can be done. Or put something in the middle to intercept and re-write the request.

  • Simon Collins
    Simon Collins Member Posts: 129 Bronze Badge

    I would agree with you. I'm a bit of a middle man in this conversation to be honest.

    I'll see if we can get some meaningful dialogue opened up with them

    Thanks

    Simon