Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 548F7753F for ; Sat, 8 Oct 2011 13:47:41 +0000 (UTC) Received: (qmail 5052 invoked by uid 500); 8 Oct 2011 13:47:41 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 5019 invoked by uid 500); 8 Oct 2011 13:47:40 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 5011 invoked by uid 99); 8 Oct 2011 13:47:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 08 Oct 2011 13:47:40 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of willem.jiang@gmail.com designates 209.85.210.173 as permitted sender) Received: from [209.85.210.173] (HELO mail-iy0-f173.google.com) (209.85.210.173) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 08 Oct 2011 13:47:34 +0000 Received: by iakl21 with SMTP id l21so2822678iak.32 for ; Sat, 08 Oct 2011 06:47:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=KHR7DaJAhcafs6E0SvzhD26obL8pgo6pPKWqD3WVpJ0=; b=BI0+w2UZZhKkZdXWEXZk9zAxfl7ot1hwLkVk79Bv8edWgxcTxo9C/wjUcX+nwAwl5a iF2Ey8u9ozjikj2zPg8oUub6sTzwoPPjIt1TV/sn+Rb4vT+GINgmimPpRr9RjBJAAYLm BI2zrmFV2lTtOtXdObLKo4OzOW6AFdFhQlbsY= Received: by 10.43.130.133 with SMTP id hm5mr3435013icc.11.1318081633797; Sat, 08 Oct 2011 06:47:13 -0700 (PDT) Received: from [192.168.0.158] ([125.34.2.158]) by mx.google.com with ESMTPS id fy35sm29256588ibb.4.2011.10.08.06.47.09 (version=SSLv3 cipher=OTHER); Sat, 08 Oct 2011 06:47:12 -0700 (PDT) Message-ID: <4E905459.3080800@gmail.com> Date: Sat, 08 Oct 2011 21:47:05 +0800 From: Willem Jiang User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: users@camel.apache.org Subject: Re: Query part of HTTP_URI header ignored References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org I just checked the code, the HttpProducer should not ignore the query part. If there is no any other setting on HttpQuery header, we should let HttpProducer use the query part of the HTTP_URI header. I just filled a JIRA[1] for it and will commit a fix shortly. [1]https://issues.apache.org/jira/browse/CAMEL-4526 On Fri Oct 7 21:28:05 2011, wing-tung Leung wrote: > We use a HttpProducer (http4) which receives a URL via the "CamelHttpUri" > header, and fetches the data from that URL. The http4 endpoint configuration > does not contain any URL at all, because this is all determined based on > dynamic message content. > > Problem is that I initially expected that the query part of the URL would be > taken into account, but the HTTP producer IGNORES the query parameter > segment when the "CamelHttpQuery" header is not set. It seems to fallback to > the query part of the endpoint, but that does not work for us since it's > empty. > > So, setting URL directly on endpoint should respect the query part, but only > setting it via the header, does NOT use the query part. I did not expect > this behavior, and find it a little confusing. Wouldn't it be better to > include the query part in BOTH cases? > > For the moment, I implemented a workaround by setting the CamelHttpQuery > header as well, but this feels like a small hack. > > > http://camel.apache.org/http4.html > > Using camel 2.5, but code seems to be unchanged in latest trunk, see line > 331 in HttpProducer.createMethod() : > > https://github.com/apache/camel/blob/trunk/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java#L331 > > Regards, > > Tung > -- Willem ---------------------------------- FuseSource Web: http://www.fusesource.com Blog: http://willemjiang.blogspot.com (English) http://jnn.javaeye.com (Chinese) Twitter: willemjiang Weibo: willemjiang