Return-Path: X-Original-To: apmail-hc-dev-archive@www.apache.org Delivered-To: apmail-hc-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C49459F33 for ; Tue, 26 Jun 2012 13:34:08 +0000 (UTC) Received: (qmail 87890 invoked by uid 500); 26 Jun 2012 13:34:08 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 87862 invoked by uid 500); 26 Jun 2012 13:34:08 -0000 Mailing-List: contact dev-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list dev@hc.apache.org Received: (qmail 87854 invoked by uid 99); 26 Jun 2012 13:34:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Jun 2012 13:34:08 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of sebbaz@gmail.com designates 209.85.160.179 as permitted sender) Received: from [209.85.160.179] (HELO mail-gh0-f179.google.com) (209.85.160.179) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Jun 2012 13:34:02 +0000 Received: by ghbg24 with SMTP id g24so3409674ghb.10 for ; Tue, 26 Jun 2012 06:33:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=Ut4smGSUA7HSZT61BiGB8txP1yHYzHaeTzpf3NQgoQg=; b=YD6ZDTmLVLinJs8fiUK7ivbd4D780b5ELmLaDWVBqtx9f33eWm4i/65QyotqFN++md yhZESq3XPnio7LJAbiGcF/dIvBsJkOux/gXoiEykJ4m4Tpm4xFptQ47I5UHwyGLjuEwB CC50HV/lLEH+YgkjHLrKYw/ouN7uIPvJB28GmPsVznM85/y0Ilyy5Y9OqaZUxiBoBlab iNLIPQQOkfnlh0bHwP9MveGbNbYSZz2JwVD9t9JePn/nhfPE0z2tmxD/5ihCHj+X6JIb b/vCuRZNz8Oobbr8KyIzSzBDODxeQmxur0vl/5qbK/tuCQ7NkJyZsgL2iYTlX9oQEk3s wnJg== MIME-Version: 1.0 Received: by 10.60.29.137 with SMTP id k9mr16478964oeh.23.1340717621523; Tue, 26 Jun 2012 06:33:41 -0700 (PDT) Received: by 10.182.71.199 with HTTP; Tue, 26 Jun 2012 06:33:41 -0700 (PDT) In-Reply-To: <1340714618.5475.24.camel@ubuntu> References: <1340714618.5475.24.camel@ubuntu> Date: Tue, 26 Jun 2012 14:33:41 +0100 Message-ID: Subject: Re: URIBuilder setQuery() method inconsistent with other set methods From: sebb To: HttpComponents Project Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org On 26 June 2012 13:43, Oleg Kalnichevski wrote: > On Tue, 2012-06-26 at 12:13 +0100, sebb wrote: >> The setQuery(String) method currently expects an escaped, ASCII-only >> string - basically encoded form data - whereas all the other set >> methods expect unescaped input. >> This is a bit confusing. >> > > Yes, I am aware of it. I was going to deprecate this method in 4.3 and > replace it with something like #parseQuery. > >> AFAIK, a query string does not have to consist of name value pairs >> (i.e. form data), it can be any arbitrary string. >> There's currently no way for the end-user to provide such a query. >> They would have to use the URI class. > > In this case it is basically a lone parameter without a value. Yes and no; depends what is allowed for a parameter name. Also, '+' only means space in the context of form data; otherwise it is just another safe character in the query. Presumably applications that use arbitrary query strings decode the query differently from ones that expect form data. >> Maybe that is OK, in which case we just need to clarify the URIBuilder >> Javadoc to state that it is only intended for use with form data >> queries. >> >> Perhaps there should be a setQuery(NVP) method which handles form data directly? >> > > Makes sense. The question is whether we should add this method in 4.2.1 > or wait until 4.3. It could wait. As could providing support for non-form data query strings; the URI class can be used meanwhile. > Oleg > >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org >> For additional commands, e-mail: dev-help@hc.apache.org >> > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org > For additional commands, e-mail: dev-help@hc.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org