hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thom Nichols <tmnich...@gmail.com>
Subject Re: Fluent HttpClient
Date Tue, 07 Jun 2011 17:43:01 GMT
I suppose you're right; you could do it like this maybe:
  builder
  .encode("utf-8")
  .addParameter("q","what is your name?")
  .noEncode()
  .setPath("monty%20python")




On Tue, Jun 7, 2011 at 12:41 PM, Lilu Xu <cookieme@gmail.com> wrote:

> But what if there exists some Unicode characters in the query, like Chinese
> characters? I plan to use java.net.URLEncoder [1] , and it requires a
> encoding scheme.
>
> Lilu
>
> [1]
> http://download.oracle.com/javase/6/docs/api/java/net/URLEncoder.html#encode(java.lang.String,
> java.lang.String)
>
> On Jun 7, 2011, at 7:31 PM, Thom Nichols wrote:
>
> > There's only one URL encoding scheme.
> > http://en.wikipedia.org/wiki/Percent-encoding
> >
> > On Tue, Jun 7, 2011 at 11:43 AM, Lilu Xu <cookieme@gmail.com> wrote:
> >
> >> Thanks for the comments.
> >> Currently, the builder assumes values are already encoded. I think it is
> a
> >> good idea to have a switcher to control the URL encoding. But do I also
> need
> >> to allow users to specify which encoding scheme should be used?
> >>
> >> Lilu
> >>
> >> On Jun 7, 2011, at 6:31 PM, Thom Nichols wrote:
> >>
> >>> Are values URL-encoded by the builder or are they assumed to already be
> >>> encoded?  You should allow the ability to do both, either by duplicate
> >>> methods like `setPathEscaped` or some funky switching like
> >>>
> >>> builder
> >>> .escaped()
> >>> .setPath("monty%20python")
> >>> .unescaped()
> >>> .addParameter("q","what is your name?")
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> >> For additional commands, e-mail: dev-help@hc.apache.org
> >>
> >>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message