5

I have my json data which i need to be posted to a url or just update the json data in one of my site urls. But i get the 405 error. This is my code.

    $.post("details", {name: "John", location: "us"});

2 Answers2

3

405 errors can be traced to configuration of the Web server and security governing access to the content of the Web site. It seems that the server to which you are sending the Post request(your Site's server) has been configured to block Post request.
You can configure your server to allow the Post request. For more details, go to http://www.checkupdown.com/status/E405.html

-1

I had the same problem. My failure was in the sort of the request:

I had a "POST" request in my mockserver.js:

  {method: "POST", path: "app/Registration/sendRegisData.*", response: function (xhr) { xhr.respondFile(200, {}, "../testdata/getUser.json"); } }

and tried to use this path with a "PUT"-call in my controller:

    $.ajax({
                url: "z_dominosapp/Registration/sendRegisData",
                type: "POST",
                data: data
            }).done(function(){.......});

First, I didn't noticed it and was wondering why only the "fail" part of the ajax call was called. Maybe this careless mistake of me helps you in any way.