Questions tagged [http-status-code-405]

"Method not allowed": generally returned if a client attempts to use an incorrect method (such as POST) for a request to a particular URL.

Web servers return the HTTP status code 405 in response to requests using a particular method for a given URL that are not among the methods the server allows for that URL.

For example, the https://developer.mozilla.org server allows the GET method for the URL https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/405 but disallows the POST method. A POST to that URL causes the server to send a response with HTTP status code 405.

That response also includes the response header Allow: GET, PUT, HEAD.

According to the HTTP specification http://httpwg.org/specs/rfc7231.html#status.405:

The origin server MUST generate an Allow header field in a 405 response containing a list of the target resource's currently supported methods.

463 questions
13
votes
1 answer

django: generic class view + POST = HTTP 405 (Method not allowed)

Recently I've started converting some of the view functions to Generic Views. Converting the function which was expected to handle POST request (via AJAX form) results in "405 Method not allowed" HTTP exception. I'm sure is not about CSRF: Ajax…
migajek
  • 8,204
  • 14
  • 71
  • 113
13
votes
3 answers

App Script sends 405 response when trying to send a POST request

I have published an app script publicly (Anyone, even anonymous) with a doPost method as follow, function doPost(e){ var sheet = SpreadsheetApp.getActiveSheet(); var length = e.contentLength; var body = e.postData.contents; var…
12
votes
3 answers

How to display a custom error page for HTTP status 405 (method not allowed) in Django when using @require_POST

My question is simple, how do I display a custom error page for HTTP status 405 (method not allowed) in Django when using the @require_POST decorator? I'm using the django.views.decorators.http.require_POST decorator, and when the page is visited…
Herman Schaaf
  • 39,417
  • 19
  • 92
  • 137
11
votes
2 answers

Getting 405 error while trying to download nltk data

When i try the below code python -c "import nltk; nltk.download('punkt'); nltk.download('averaged_perceptron_tagger'); nltk.download('maxent_treebank_pos_tagger'); nltk.download('wordnet')" the console says [nltk_data] Error loading punkt:…
user2478236
  • 571
  • 9
  • 25
10
votes
3 answers

fb iframe application: 405 error

my application works fine without iframe, returns 405 error at facebook! why is it so?
ehmad11
  • 1,331
  • 2
  • 13
  • 28
10
votes
3 answers

MVC 4. IIS 7.5 PUT returning 405

I'm trying to use PUT in an MVC 4 application and I'm getting a 405 error. In my routing I have a constraint on the route to allow PUT and POST, POST to the endpoint works, PUT fails with a 405. I've followed the advice here ASP.NET Web API returns…
Kevin Jones
  • 2,339
  • 16
  • 25
9
votes
2 answers

Error HTTP/1.0 405 Method not Allowed

I want to make an Htttp Connection Here is my code try { HttpClient client = new DefaultHttpClient(); HttpPost httpMethod = new HttpPost("http://www.google.co.in/"); String requestBody = "some text"; HttpMethod.setEntity(new…
Rozy
  • 769
  • 3
  • 7
  • 11
9
votes
1 answer

Enabling POST/PUT/DELETE on AWS CloudFront?

In AWS CloudFront I set this within: "Allowed HTTP Methods" in the "Default Cache Behavior Settings" area: GET, HEAD, OPTIONS, PUT, POST, PATCH, DELETE My CloudFront is linked to an AWS S3 bucket. So I set the AWS S3 CORS configuration to:
8
votes
1 answer

Heroku and Django with 405 error

I am trying to move my django project from an apache setup over to heroku. At this point, everything seems to be working fine except for an issue I am having with using the PATCH Http Method (which I use in conjuction with django-tastypie). I…
tonyl7126
  • 1,478
  • 1
  • 13
  • 18
7
votes
3 answers

WebRequest "HEAD" light weight alternative

I recently discovered that the following does not work with certain sites, such as IMDB.com. class Program { static void Main(string[] args) { try { System.Net.WebRequest wc =…
Serapth
  • 6,927
  • 3
  • 28
  • 37
7
votes
3 answers

What can be causing IIS to receive the HTTP verb "2GET"

I have a user who is intermittently receiving an HTTP 405 when clicking a link within my application. There is nothing funny about the link, as far as I can see... -…
sandy
  • 873
  • 9
  • 24
7
votes
3 answers

WCF The request failed with HTTP status 405: Method Not Allowed

I have a WCF service that has been hosted on a Windows Service and uses the BasicHttp endpoint to serve Windows Mobile devices that has been connected to it. The problem is that with the Device Emulator. I can connect to the service and using it…
mrtaikandi
  • 6,018
  • 14
  • 55
  • 92
7
votes
2 answers

Fine Uploader to S3 bucket getting 405 Method Not Allowed error

I have been banging my head against the wall on this and am entirely stumped. I am trying to use FineUploader to upload files directly to my Amazon S3 bucket. I have essentially copied the code from the fineuploader.com web page (Upload Files…
6
votes
4 answers

405: Method Not Allowed

EDIT: Summary: It seems that my web app can be accessed by anyone (only firefox or chrome) and by me using my main computer. If i try to access http://luiscarlosch.com/WebFormClean.aspx from any other of my LAN it gets a 405 error I can perfectly…
Luis Carlos Chavarría
  • 3,551
  • 2
  • 23
  • 26
6
votes
1 answer

HTTP POST method treated like GET on WebApi

I've been creating a WebApi controller, and I'm trying to use a HttpPost request to submit a new user for registration. This works fine on my localhost, but when I publish it to Azure I get a 405 method not allowed error with the message: "The…
1
2
3
30 31