Ajax.Request Returning 405 Http Response

Today I experienced the problem of 405 HTTP Response on a production server while that didn’t happen in the test instance. This happened when doing an Ajax request using prototype.js Ajax.Request. The request is to fetch some static html. After a bit of a struggle, I realized that the default method option of Ajax.Request is POST and if the server is not configured (I don’t know how) to treat POST as GET for static content, this issue can happen. So, adding method: “GET” to the options list solved the problem.

3 Comments

Filed under AJAX

3 responses to “Ajax.Request Returning 405 Http Response

  1. Nir

    Thanks a lot, mate, that helped a lot!

  2. Thanks for the tip. Help save a lot of time.

Leave a reply to Blia Cancel reply