I was scratching my head over a problem today where a
jQuery ajax request was failing on one particular web server with a '406 Not Acceptable' error. It had been tested on many other servers without any trouble, but this seemingly normal Apache server wasn't having a bar of it.
It turned out the problem was that I was submitting the ajax request using the POST method but not actually sending any post data. For example:
$.ajax({
type: "POST",
url: "index.php?action=foo",
success: function(msg){
// ...
}
});
Changing it to a GET sorted out the problem.
6 comments:
Genius! You just saved me from hours of headaches.
Same feeling! You saved me a lot of testing. THANKS.
From the very west,
zecoelho
Thanks!!!!!!!!!!!!!!!!!!
Great...
I wasted my too much time to resolve this problem.
Thankx....
Great...
I wasted my too much time to resolve this problem.
Thankx....
Thanks a lot man!!!
Post a Comment