The HTTP verb POST used to access path '/test.html' is not allowed

前端 未结 5 1705
眼角桃花
眼角桃花 2021-01-19 13:55

Below is my code:

相关标签:
5条回答
  • 2021-01-19 14:06

    Are you using any URL rewriting? (http://forums.asp.net/t/953470.aspx)

    In the webserver, is POST allowed for HTML files? Try changing the extension to .ASPX or .PHP

    0 讨论(0)
  • 2021-01-19 14:11

    I found this post while working on my first Facebook app, so this may or may not be related to your underlying issue...but I was getting this same error.

    While a Canvas URL value has to end in "/", the Tabl URL can be a fully qualified page (e.g. http://[DOMAIN/DIRECTORY-PATH]/Default.aspx).

    I'm working locally, so http://localhost:4604/Main/Default.aspx worked for me.

    HttpGet, HttpPost protocols do not appear to be required in the web.config (although this fix still worked with them in there).

    0 讨论(0)
  • 2021-01-19 14:22

    The first that comes to mind is permissions.

    What version of IIS ? By default IIS6 prevents a post to a HTML file.

    0 讨论(0)
  • 2021-01-19 14:26

    This sounds like the directive is used in your (supposedly) Apache web server? You would need to check the httpd.conf for this directive and make sure that POST is allowed to be called on your file.

    Nevertheless does it seem a little odd to POST on a static html file or is mod_rewrite being used to confuse people?

    0 讨论(0)
  • 2021-01-19 14:29

    The default for this error is that the POST verb is turned off at the configuration for the server. Is this happening in Cassini or in IIS? In IIS this behavior can be controlled. Also you may want to make sure that the proper handlers are in your web.config if you are still having issues after looking at the IIS configuration (if this ends up being web service related):

    <system.web>  
        <webServices>    
            <protocols>    
                <add name="HttpGet"/>
                <add name="HttpPost"/>
    
    0 讨论(0)
提交回复
热议问题