[httpclient] controlling the output?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[httpclient] controlling the output?

kokaku
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 (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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [httpclient] controlling the output?

olegk
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: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [httpclient] controlling the output?

kokaku
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 <[hidden email]> 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: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]