java - com.amazonaws.AmazonClientException : Data read has a different length than the expected

标签 java http amazon-web-services http-headers aws-sdk

我在处理接受 PUT 调用的 rest api 的过程中遇到了这个问题,然后使用 AWS S3 Java API 将推送的内容流式传输到 S3。

我得到的错误是这样的:

Caused by: com.amazonaws.AmazonClientException: Data read has a different length than the expected: dataLength=365; expectedLength=366; includeSkipped=false; in.getClass()=class org.duracloud.common.stream.ChecksumInputStream; markedSupported=false; marked=0; resetSinceLastMarked=false; markCount=0; resetCount=0

我正在使用 aws-java-sdk 1.9.1。

这个问题是我从v.1.7.3升级后出现的

最佳答案

虽然我不清楚 aws sdk 中到底是什么导致了这个问题,但我通过将内容类型 http header 显式设置为“application/x-www-form-urlencoded”以外的其他内容来解决这个问题是 curl 和 jquery 发送的默认值。

关于java - com.amazonaws.AmazonClientException : Data read has a different length than the expected,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28976697/

相关文章:

amazon-web-services - 从本地连接到客户端 cassandra

java - ParseException:无法解析的日期

http - OneDrive 巨大的流式上传

java - MP3 文件在读取过程中失真

http - 深入学习http协议(protocol)的好资源

java - JSoup 抛出 IO 异常 : Too many redirects occurred trying to load URL

amazon-web-services - AWS AppSync 中订阅的自定义筛选

amazon-web-services - 如何验证 RDS 数据库中的数据是否已静态加密?

java - Best Java Functor lib : JGA, commons functor, mango, or...?

java - rx java observable 仅在匹配的 observable 上链接