405 -- Method Not Allowed

software development

#1

So I’ve decided to muck around in Javascript/AJAX. I blame the internet for all the hype about it.

Anyway, the problem I have is that when making a request for a page it’s returning a 405 error (which is Method Not Allowed).

That’s the explanation I found for it.

This error is given in response to a POST request.

The temporary fix I found for this was to convent the page being referenced to a .PHP file. I was wondering if there was any way to have this work with a plain .txt or .html file?


#2

This is one of those things that you have to think through.

POST is used to provide input that is going to be processed on the web site.

Plain text files and HTML documents do not process anything, so POST is meaningless. The web server doesn’t do anything but read the contents of the file to the browser. Instead of silently passing the input to /dev/null, you’re going to get an error.

You already have the answer. The request must be of a resource the web server recognizes as handling input for processing - ie CGI.

See Why do I keep getting “Method Not Allowed” for form POST requests?

:cool: [color=#6600CC]Atropos[/color] | openvein.org