You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by charlie <ch...@gmail.com> on 2009/06/18 02:03:52 UTC

PostMethod.setQueryString vs PostMethod.addParameter

Java 1.6
HttpClient 3.1
OS: Windows & Linux

I'm seeing some odd behavior, I am trying to POST to a website, using the
setQueryString method with my test data, it works fine all goes well.  Using
the addParameter(key,value)  , I get a post fail ( unfortunately the website
doesn't report what's going wrong ).

Normally I'd say fine I'll just use the setQuery , but the real world data
is much bigger, and I'm getting a URL that exceeds the standards when I try
to post.

Has anyone else seen or experienced this ?

Thanks,
Charlie
csanders@hoovers.com

Re: PostMethod.setQueryString vs PostMethod.addParameter

Posted by Oleg Kalnichevski <ol...@apache.org>.
charlie wrote:
> Ill setup perl cgi and use both methods against them and just dump the the
> headers and such, see if there is any difference.
> 

You do not need to do that. Just turn the wire logging on.

http://hc.apache.org/httpclient-3.x/logging.html

Oleg

> On Thu, Jun 18, 2009 at 9:13 AM, Oleg Kalnichevski <ol...@apache.org> wrote:
> 
>> On Thu, Jun 18, 2009 at 09:08:42AM -0500, charlie wrote:
>>> I've succesfully used cURL to post to this website in the past, I don't
>>> think its a server side issue.  Server side is using PERL if that means
>>> anything.
>>>
>> You are very welcome to disgree. This is the only explanation I can think
>> of
>> given the description of the problem.
>>
>> Oleg
>>
>>
>>> On Thu, Jun 18, 2009 at 8:54 AM, Oleg Kalnichevski <ol...@apache.org>
>> wrote:
>>>> On Wed, Jun 17, 2009 at 07:03:52PM -0500, charlie wrote:
>>>>> Java 1.6
>>>>> HttpClient 3.1
>>>>> OS: Windows & Linux
>>>>>
>>>>> I'm seeing some odd behavior, I am trying to POST to a website, using
>> the
>>>>> setQueryString method with my test data, it works fine all goes well.
>>>>  Using
>>>>> the addParameter(key,value)  , I get a post fail ( unfortunately the
>>>> website
>>>>> doesn't report what's going wrong ).
>>>>>
>>>>> Normally I'd say fine I'll just use the setQuery , but the real world
>>>> data
>>>>> is much bigger, and I'm getting a URL that exceeds the standards when
>> I
>>>> try
>>>>> to post.
>>>>>
>>>>> Has anyone else seen or experienced this ?
>>>>>
>>>> This does not sound like a client side issue to me. Most likely the
>> server
>>>> side
>>>> script differentiates between query arguments and request entity
>>>> parameters.
>>>>
>>>> Oleg
>>>>
>>>>
>>>>
>>>>> Thanks,
>>>>> Charlie
>>>>> csanders@hoovers.com
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
>>>> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>>>>
>>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
>> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>>
>>
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: PostMethod.setQueryString vs PostMethod.addParameter

Posted by charlie <ch...@gmail.com>.
Ill setup perl cgi and use both methods against them and just dump the the
headers and such, see if there is any difference.

On Thu, Jun 18, 2009 at 9:13 AM, Oleg Kalnichevski <ol...@apache.org> wrote:

> On Thu, Jun 18, 2009 at 09:08:42AM -0500, charlie wrote:
> > I've succesfully used cURL to post to this website in the past, I don't
> > think its a server side issue.  Server side is using PERL if that means
> > anything.
> >
>
> You are very welcome to disgree. This is the only explanation I can think
> of
> given the description of the problem.
>
> Oleg
>
>
> > On Thu, Jun 18, 2009 at 8:54 AM, Oleg Kalnichevski <ol...@apache.org>
> wrote:
> >
> > > On Wed, Jun 17, 2009 at 07:03:52PM -0500, charlie wrote:
> > > > Java 1.6
> > > > HttpClient 3.1
> > > > OS: Windows & Linux
> > > >
> > > > I'm seeing some odd behavior, I am trying to POST to a website, using
> the
> > > > setQueryString method with my test data, it works fine all goes well.
> > >  Using
> > > > the addParameter(key,value)  , I get a post fail ( unfortunately the
> > > website
> > > > doesn't report what's going wrong ).
> > > >
> > > > Normally I'd say fine I'll just use the setQuery , but the real world
> > > data
> > > > is much bigger, and I'm getting a URL that exceeds the standards when
> I
> > > try
> > > > to post.
> > > >
> > > > Has anyone else seen or experienced this ?
> > > >
> > >
> > > This does not sound like a client side issue to me. Most likely the
> server
> > > side
> > > script differentiates between query arguments and request entity
> > > parameters.
> > >
> > > Oleg
> > >
> > >
> > >
> > > > Thanks,
> > > > Charlie
> > > > csanders@hoovers.com
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> > > For additional commands, e-mail: httpclient-users-help@hc.apache.org
> > >
> > >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>

Re: PostMethod.setQueryString vs PostMethod.addParameter

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Thu, Jun 18, 2009 at 09:08:42AM -0500, charlie wrote:
> I've succesfully used cURL to post to this website in the past, I don't
> think its a server side issue.  Server side is using PERL if that means
> anything.
> 

You are very welcome to disgree. This is the only explanation I can think of
given the description of the problem.

Oleg


> On Thu, Jun 18, 2009 at 8:54 AM, Oleg Kalnichevski <ol...@apache.org> wrote:
> 
> > On Wed, Jun 17, 2009 at 07:03:52PM -0500, charlie wrote:
> > > Java 1.6
> > > HttpClient 3.1
> > > OS: Windows & Linux
> > >
> > > I'm seeing some odd behavior, I am trying to POST to a website, using the
> > > setQueryString method with my test data, it works fine all goes well.
> >  Using
> > > the addParameter(key,value)  , I get a post fail ( unfortunately the
> > website
> > > doesn't report what's going wrong ).
> > >
> > > Normally I'd say fine I'll just use the setQuery , but the real world
> > data
> > > is much bigger, and I'm getting a URL that exceeds the standards when I
> > try
> > > to post.
> > >
> > > Has anyone else seen or experienced this ?
> > >
> >
> > This does not sound like a client side issue to me. Most likely the server
> > side
> > script differentiates between query arguments and request entity
> > parameters.
> >
> > Oleg
> >
> >
> >
> > > Thanks,
> > > Charlie
> > > csanders@hoovers.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> > For additional commands, e-mail: httpclient-users-help@hc.apache.org
> >
> >

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: PostMethod.setQueryString vs PostMethod.addParameter

Posted by charlie <ch...@gmail.com>.
I've succesfully used cURL to post to this website in the past, I don't
think its a server side issue.  Server side is using PERL if that means
anything.

On Thu, Jun 18, 2009 at 8:54 AM, Oleg Kalnichevski <ol...@apache.org> wrote:

> On Wed, Jun 17, 2009 at 07:03:52PM -0500, charlie wrote:
> > Java 1.6
> > HttpClient 3.1
> > OS: Windows & Linux
> >
> > I'm seeing some odd behavior, I am trying to POST to a website, using the
> > setQueryString method with my test data, it works fine all goes well.
>  Using
> > the addParameter(key,value)  , I get a post fail ( unfortunately the
> website
> > doesn't report what's going wrong ).
> >
> > Normally I'd say fine I'll just use the setQuery , but the real world
> data
> > is much bigger, and I'm getting a URL that exceeds the standards when I
> try
> > to post.
> >
> > Has anyone else seen or experienced this ?
> >
>
> This does not sound like a client side issue to me. Most likely the server
> side
> script differentiates between query arguments and request entity
> parameters.
>
> Oleg
>
>
>
> > Thanks,
> > Charlie
> > csanders@hoovers.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>

Re: PostMethod.setQueryString vs PostMethod.addParameter

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Wed, Jun 17, 2009 at 07:03:52PM -0500, charlie wrote:
> Java 1.6
> HttpClient 3.1
> OS: Windows & Linux
> 
> I'm seeing some odd behavior, I am trying to POST to a website, using the
> setQueryString method with my test data, it works fine all goes well.  Using
> the addParameter(key,value)  , I get a post fail ( unfortunately the website
> doesn't report what's going wrong ).
> 
> Normally I'd say fine I'll just use the setQuery , but the real world data
> is much bigger, and I'm getting a URL that exceeds the standards when I try
> to post.
> 
> Has anyone else seen or experienced this ?
> 

This does not sound like a client side issue to me. Most likely the server side
script differentiates between query arguments and request entity parameters. 

Oleg



> Thanks,
> Charlie
> csanders@hoovers.com

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org