本文介绍OSS返回411错误的原因和解决方案。

MissingContentLength

  • 错误信息:You must provide the Content-Length HTTP header.
  • 问题原因:缺少内容长度,消息为非chunked encoding或者没有携带Content-Length
  • 解决方案:请确保请求头采用了chunked encoding的编码方式,或者设置了Content-Length

ObjectNotAppendable

  • 错误消息:The object is not appendable.
  • 问题原因:对一个不是可追加类型(Appendable)的Object执行AppendObject操作。
  • 解决方案:OSS有三种类型的Object,分别为Normal、Appendable和Multipart。只有Appendable类型的Object才能执行AppendObject操作。请通过GetBucket (ListObjects)接口获取Object的存储类型。