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 Jeff Segal <je...@gmail.com> on 2013/06/17 21:28:04 UTC

HTTP GET with duplicate parameters in query string

I am trying to use URIBuilder to create a URI representing a request to an
endpoint that supports duplicate parameters in the query string. In other
words, a request might look like "http://example.com/service?foo=bar&foo=baz".
>From my tests it looks like URIBuilder.setParameter() does not support
this, instead only allowing one value per key. I can still hard code the
URL manually, but it'd be nice to use the URIBuilder API to construct my
requests. That said, I'm not sure if this would represent an extension or
violation of HTTP 1.1. Thoughts?

Thanks,
Jeff

Re: HTTP GET with duplicate parameters in query string

Posted by Jeff Segal <je...@gmail.com>.
Thanks Oleg, looks like I missed that method.


On Tue, Jun 18, 2013 at 4:49 AM, Oleg Kalnichevski <ol...@apache.org> wrote:

> On Mon, 2013-06-17 at 15:28 -0400, Jeff Segal wrote:
> > I am trying to use URIBuilder to create a URI representing a request to
> an
> > endpoint that supports duplicate parameters in the query string. In other
> > words, a request might look like "
> http://example.com/service?foo=bar&foo=baz".
> > From my tests it looks like URIBuilder.setParameter() does not support
> > this, instead only allowing one value per key. I can still hard code the
> > URL manually, but it'd be nice to use the URIBuilder API to construct my
> > requests. That said, I'm not sure if this would represent an extension or
> > violation of HTTP 1.1. Thoughts?
> >
> > Thanks,
> > Jeff
>
> Jeff,
>
> URIBuilder#addParameter() is your friend.
>
> Oleg
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>

Re: HTTP GET with duplicate parameters in query string

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Mon, 2013-06-17 at 15:28 -0400, Jeff Segal wrote:
> I am trying to use URIBuilder to create a URI representing a request to an
> endpoint that supports duplicate parameters in the query string. In other
> words, a request might look like "http://example.com/service?foo=bar&foo=baz".
> From my tests it looks like URIBuilder.setParameter() does not support
> this, instead only allowing one value per key. I can still hard code the
> URL manually, but it'd be nice to use the URIBuilder API to construct my
> requests. That said, I'm not sure if this would represent an extension or
> violation of HTTP 1.1. Thoughts?
> 
> Thanks,
> Jeff

Jeff,

URIBuilder#addParameter() is your friend.

Oleg



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