commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Kriger <andy.kri...@gmail.com>
Subject Re: [httpclient] controlling the output?
Date Tue, 27 Sep 2005 14:47:19 GMT
Thank you very very much - after creating the Part[] I did what you
suggested and that fixed the problem. My form submits, my boss is
relaxed, and there is happiness in the land.

Here's the code I used...
for(PartBase p : parts) {
	p.setContentType(null);
	p.setTransferEncoding(null);
}

Thx again
andy

On 9/27/05, Oleg Kalnichevski <olegk@apache.org> wrote:
> On Mon, Sep 26, 2005 at 06:06:12PM -0400, Andy Kriger wrote:
> > I'm submitting a multipart form post and the server is rejecting it
> > (because of "corrupt form data"). Not sure what that means but I'm
> > trying to get the output from httpclient to look exactly like some
> > output that I know works (generated with Firefox, the actual form and
> > the LiveHTTPHeaders plugin). One thing I see in the httpclient logs is
> > that each part has a Content-Type and Content-Transfer-Encoding (which
> > the Firefox output does not).
> >
> > I'd like to suppress these from being sent - is there a way I can do
> > this? If not, can anyone suggest where I'd start in the source code to
> > do this
>
> Andy,
>
> This problem is not uncommon. Many CGI scripts out there have been
> written to work with IE only, and IE does not quite follow the spec with
> regards to setting the correct content type and transfer encoding
> attributes.
>
> To work the problem around simply set FilePart#setContentType() and
> FilePart#setTransferEncoding() to null
>
> Hope this helps
>
> Oleg
>
>
> (just a quick and dirty solution - if that ends up working,
> > I'll try to come up with something flexible that can be rolled into
> > the project).
> >
> > thx
> > andy
> >
> > ---------------------------------------------------------------------
> > 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
>
>

---------------------------------------------------------------------
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