I have a request from a developer to "accept but ignore" POST requests made to an XML file on an IIS server. It is used for testing something I don't understand. By default, when I put the XML file in the IIS site root and access it via the browser (GET) I get the response I expect. However, if I run the following command:
curl --data "test=test" https://server/example.xml
I get this response:
405 - HTTP verb used to access this page is not allowed. The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access.
He just wants a 200 response even if you send POST data. I found an old SO question that pointed to this article, but it is a very old version of IIS and when I tried it it did not help. I tried adding an XML handler mapping but no matter what I picked for "type" I kept getting other errors (usually ASP.net).
It looks like the instructions from this forum post are working. The trick was adding a "script" map instead of a regular handler.