commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: [httpclient] Non-Encoded POST Request
Date Tue, 08 Mar 2005 19:54:57 GMT
Dylan,

You can set any request content you want using whatever encoding you
deem appropriate simply by calling PostMethod#setRequestBody(String) or
PostMethod#setRequestBody(InputStream) methods

Hope this helps

Oleg


On Mon, 2005-03-07 at 17:06 -0800, Dylan Stamat wrote: 
> Hello !
> 
> I'm working with a company who can't accept encoded POST's, which is
> non-W3C standard, but I have to make due with this.
> 
> I've tried sub-classing the PostMethod class, and overriding the
> generateRequestEntity() method with no luck.  Even when using
> different Content-Type's, no luck.  Here is my implementation of the
> generateRequestEntity() method (part of):
> 
> ==========================
>                 String content = 
>                     EncodingUtil.formUrlEncode(getParameters(),
>                             StringPart.DEFAULT_CHARSET);
>                 ByteArrayRequestEntity entity = 
>                     new ByteArrayRequestEntity(
>                             EncodingUtil.getAsciiBytes(content), 
>                             "text/plain");
> ==========================
> 
> Anybody have any ideas ?
> Are non-encoded POST requests even supported !?
> 
> Thanks !
> ==
> Dylan
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message