Search code examples
postmansoapuihttp-status-code-405

PostMan returns 405 but SoapUI returns 200 for same POST request


I am having a strange behavior I am observing. I use PostMan and until now, it always worked fine for me.

I have POST request to http://domain/endpoint with a JSON body and BasicAuth

The same / identical request issued in:

  • PostMan is failing in with 405 Method Not Allowed
  • SoapUI returns 200 OK with response body back.

Both requests are identical. I basically copied the URI, the body and basic auth credentials from my PostMan into SoapUI request and it worked.

I also tried rewerting the process by manually copying all the details from SoapUI into Postman and the request would return 405. Other requests in PostMan are working just fine.

I cannot share the URI, body, and credentials but they are identical on both PostMan and SoapUI.


Solution

  • I found the reason but I am finding this to be very strange behavior in PostMan if not a bug

    What I found in PostMan console (when my request returns 405) is that my POST request to http, gets redirected to GET request to https:

    enter image description here

    Investigating further, I find that you have to change this behavior by going to PostMan > your POST request > your request settings > and make sure you have turned ON "Follow original HTTP Method" setting like:

    enter image description here

    After this change, my POST to http gets redirected to POST https request.

    It is strange this this is by default OFF. I did not have to do any of this in SoapUI.