HTTP status code 411

更新时间:
复制 MD 格式

OSS returns HTTP 411 when a request is missing a required body length specification. The following table lists the errors returned with this status code.

Error codeError messageError type
MissingContentLengthYou must provide the Content-Length HTTP headerClient
ObjectNotAppendableThe object is not appendableClient

MissingContentLength

Error message: You must provide the Content-Length HTTP header

Cause: The request does not use chunked encoding or does not contain a Content-Length header.

Solution: Include Content-Length in the request header, or use chunked encoding.

To include Content-Length, add the header with the exact byte length of the request body:

PUT /exampleobject HTTP/1.1
Host: examplebucket.oss-cn-hangzhou.aliyuncs.com
Date: Fri, 20 Mar 2026 08:00:00 GMT
Authorization: <authorization-string>
Content-Length: <byte-length-of-body>

<request body>

To use chunked encoding instead, set Transfer-Encoding: chunked and omit Content-Length. For the full list of supported headers, see Common HTTP headers.

ObjectNotAppendable

Error message: The object is not appendable

Cause: The AppendObject operation was called on an object that was not created through append upload.

OSS objects fall into three types based on how they were uploaded:

TypeCreated bySupports AppendObject
Normal objectPutObjectNo
Append objectAppendObjectYes
Multipart objectCompleteMultipartUploadNo

AppendObject can only be called on append objects.

Solution: Check the object type before calling AppendObject. Use ListObjects (GetBucket) to retrieve the object type. If the object is a normal or multipart object and you need to append data, upload a new append object instead.