Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If I want to allow HTTP POST to text files *.txt (i.e. I'm taking an example of what could be any static resource normally accessible by GET).

The error is:

Server Error

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.

How can I accomplish this?

Background: I'm using to hit my hosted facebook app and facebook sends HTTP POST now through to the iFrame hosting my app. This facebook behaviour has been around for a while but it's being forced now. In turn this forces me to make stuff available to the POST verb.

share|improve this question
up vote 1 down vote accepted

I believe that IIS supports POSTs on most extension types. Are you using IIS7 or 7.5? I just tested with a .txt file in IIS7.5 and it handles a POST just fine.

I would check in your applicationHost.config (c:\windows\system32\inetsrv), search for the section and check your StaticFile handler, or if you already have a handler for your extension type. The same may be set in your web.config file. Confirm that the verbs property allows for POST.

share|improve this answer

A quick workaround, depending on how limited your access is to admin apps, is to rename to a properly configured filetype. You can, for example, provide static content as an aspx file. replace "file.txt" with "file.aspx" and you're done (if aspx is allowed to handle POST, which it should be by default).

share|improve this answer

I am running IIS7 and had to go to the folder I wanted to post inside the IIS Manager to and then go over to "Request Filtering" and you can add "verbs" like post, get..

This will remove the 405 error..

share|improve this answer

I had similar issue. Our application was trying to send POST requests to static json file hosted on IIS. I fixed it by updating web.config file:

<?xml version="1.0" encoding="UTF-8"?>
            <add name="JSON" path="*.json" verb="GET,POST" modules="IsapiModule" scriptProcessor="C:\Windows\System32\inetsrv\asp.dll" resourceType="File" requireAccess="None" />
                    <add fileExtension=".json" allowed="true" />
                    <add verb="POST" allowed="true" />
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.