Amazon S3 Getting Error 501 on PUT

When testing a new application, one tester always has its downloads on S3. We send the PUT request for the ~ 1.2mb file to S3 and set its ACL perms. For him, he always gets error 501 - Not Implemented.

Here are his headings for the query:

"Accept-Encoding" = gzip; Authorization = "AWS ###:###"; "Content-Encoding" = gzip; "Content-Length" = 1420267; "Content-Type" = "application/octet-stream"; Date = "Thu, 6 Oct 2011 02:59:47 +0000"; "User-Agent" = "MyApp 1.0 (iPhone; iPhone OS 4.3.1; en_US)"; "x-amz-acl" = "public-read-write"; 

Here are the response headers:

 Connection = close; "Content-Length" = 321; "Content-Type" = "application/xml"; Date = "Thu, 06 Oct 2011 03:00:14 GMT"; Server = AmazonS3; 

Any thoughts are welcome!

The response is returned with a status code of 501 and the line - "The title you specified implies functionality that is not implemented"

+4
source share
4 answers

Some update on this topic as I was looking for the answers myself. This is apparently a pretty general error message with more than one possible cause.

For javascript api the bug for empty body was fixed on December 24, 2012:

Recently, iOS 8 has had issues with aggressive (and non-standard) caching, which Amazon doesn't like. If there was any GetObject before, the If-Modified-Since header is sent for subsequent requests for the same object / url, even for PUT requests:

+3
source

The response body contains XML in which the header does not like, for example:

 <?xml version="1.0" encoding="UTF-8"?> <Error> <Code>NotImplemented</Code> <Message>A header you provided implies functionality that is not implemented</Message> <Header>If-Modified-Since</Header> </Error> 

I set the caching policy of my NSURLRequest to NSURLRequestReloadIgnoringCacheData and stopped adding the unwanted If-Modified-Since header:

  mutableURLRequest = [[NSMutableURLRequest alloc] initWithURL:theURL]; [mutableURLRequest setCachePolicy:NSURLRequestReloadIgnoringCacheData]; 
+3
source

A 501 Amazon response code may be sent if Content-Length is not specified.

Since you say that it is, I suggest running the request through a proxy ( Charles for Mac or Fiddler for Windows) and make sure that the sent request actually includes the Content-Length header

+2
source

I had this problem in Perl with CPAN Net :: Amazon :: S3 :: Client. I reviewed the request and response, and I put together the problem, which was that I lacked the ability to request via HTTPS. I fixed it by installing LWP :: Protocol :: https.

0
source

All Articles