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.

Advertisements

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

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s