HttpClient:禁用分块编码

编程入门 行业动态 更新时间:2024-10-24 08:21:54
本文介绍了HttpClient:禁用分块编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在使用Apache Commons HttpClient和Restlet来调用一个宁静的Web服务。不幸的是,我的服务器(基于Ruby on Rails)不喜欢HttpClient默认使用的 Transfer-Encoding:chunked 。

I am using the Apache Commons HttpClient along with Restlet to call a restful web service. Unfortunately, my server (based on Ruby on Rails) does not like the Transfer-Encoding: chunked that HttpClient is using by default.

有没有办法禁止从客户端使用分块编码用于POST?

Is there any way to disable the usage of chunked encoding for POSTs from the client?

推荐答案

如上所述Restlet邮件列表,在Restlet 2.1版中,您可以将ClientResource#entityBuffering属性设置为true以缓存内存中的内容并防止分块编码。

As said in Restlet mailing list, in Restlet version 2.1, you can set ClientResource#entityBuffering property to true to cache content in memory and prevent chunked encoding.

更多推荐

HttpClient:禁用分块编码

本文发布于:2023-11-14 04:44:01,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1586249.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:HttpClient

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!