Return-Path: Delivered-To: apmail-camel-commits-archive@www.apache.org Received: (qmail 91837 invoked from network); 21 Jan 2010 10:15:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 21 Jan 2010 10:15:18 -0000 Received: (qmail 576 invoked by uid 500); 21 Jan 2010 10:15:18 -0000 Delivered-To: apmail-camel-commits-archive@camel.apache.org Received: (qmail 534 invoked by uid 500); 21 Jan 2010 10:15:18 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 525 invoked by uid 99); 21 Jan 2010 10:15:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jan 2010 10:15:18 +0000 X-ASF-Spam-Status: No, hits=-1998.5 required=10.0 tests=ALL_TRUSTED,WEIRD_PORT X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jan 2010 10:15:16 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 361062388900; Thu, 21 Jan 2010 10:14:55 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r901634 - in /camel/trunk/components: camel-http/src/main/java/org/apache/camel/component/http/DefaultHttpBinding.java camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpRouteTest.java Date: Thu, 21 Jan 2010 10:14:55 -0000 To: commits@camel.apache.org From: ningjiang@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100121101455.361062388900@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ningjiang Date: Thu Jan 21 10:14:54 2010 New Revision: 901634 URL: http://svn.apache.org/viewvc?rev=901634&view=rev Log: CAMEL-2386 Parsing the request parameter for the POST method Modified: camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/DefaultHttpBinding.java camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpRouteTest.java Modified: camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/DefaultHttpBinding.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/DefaultHttpBinding.java?rev=901634&r1=901633&r2=901634&view=diff ============================================================================== --- camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/DefaultHttpBinding.java (original) +++ camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/DefaultHttpBinding.java Thu Jan 21 10:14:54 2010 @@ -79,8 +79,9 @@ } //we populate the http request parameters for GET and POST + String method = request.getMethod(); - if (method.equalsIgnoreCase("GET") || (method.equalsIgnoreCase("POST") && contentType.equalsIgnoreCase("application/x-www-form-urlencoded"))) { + if (method.equalsIgnoreCase("GET") || (method.equalsIgnoreCase("POST"))) { names = request.getParameterNames(); while (names.hasMoreElements()) { String name = (String)names.nextElement(); Modified: camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpRouteTest.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpRouteTest.java?rev=901634&r1=901633&r2=901634&view=diff ============================================================================== --- camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpRouteTest.java (original) +++ camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpRouteTest.java Thu Jan 21 10:14:54 2010 @@ -113,6 +113,18 @@ String out = context.getTypeConverter().convertTo(String.class, response); assertEquals("Get a wrong output " , "OK", out); } + + @Test + public void testPostParameterInURI() throws Exception { + HttpClient client = new HttpClient(); + PostMethod post = new PostMethod("http://localhost:9080/post?request=PostParameter&others=bloggs"); + StringRequestEntity entity = new StringRequestEntity(POST_MESSAGE, "application/xml", "UTF-8"); + post.setRequestEntity(entity); + client.executeMethod(post); + InputStream response = post.getResponseBodyAsStream(); + String out = context.getTypeConverter().convertTo(String.class, response); + assertEquals("Get a wrong output " , "PostParameter", out); + } protected void invokeHttpEndpoint() throws IOException { template.requestBodyAndHeader("http://localhost:9080/test", expectedBody, "Content-Type", "application/xml");