---
title: "HttpClient chunked 编码"
author: "fenglin"
date: "2008-05-25T23:48:38Z"
tags: []
slug: "httpclient-chunked"
draft: false
lastmod: "2008-05-25T23:48:38Z"
id: 196814
url: "https://fenglin.iteye.com/blog/196814"
---

HttpClient 支持chunked编码

需要注意的是

```java
httpClient.executeMethod(postMethod);
```

执行后并不会抓取ResponseBody

必须

```java
System.out.println(postMethod.getResponseBodyAsString());
```


getResponseBody();

API DOC:
<http://hc.apache.org/httpclient-3.x/apidocs/org/apache/commons/httpclient/ChunkedInputStream.html>