One way to use is StringBody
http://hc.apache.org/httpcomponents-client-ga/download.html
HttpClient client = new DefaultHttpClient();
MultipartEntity entity = new
MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);
entity.addPart("xml", new StringBody("YOUR XML DATA"));
HttpPost post = new HttpPost(url);
post.setEntity(entity);
~Anil
On Fri, Oct 15, 2010 at 11:11 AM, Nation, Carey <[email protected]>wrote:
> I'm sure this is obvious and I'm sure I just didn't ask google the
> proper question, but I'm stumped.
>
>
>
> I need to post a big blob of xml to a servlet. The xml needs to be in
> the request body. In 3.x you said something like req.setBody( string).
> I can't find anything like that in 4.x. I just need it to end up:
>
>
>
> Content-type: text/xml
>
> Content-length: yourLengthHere
>
>
>
> <xml />
>
>
>
> Thanks!
>
>
>
>
>
> ________________________________
>
> Carey Nation <mailto:[email protected]>
> Lead Software Engineer
> CNN BEST
> Broadcast Production Systems
> Video Solutions Group
> (404)827-2935 (wk)
> (404)824-0033 (cell)
>
> ________________________________
>
>