You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2008/11/07 16:07:17 UTC
svn commit: r712148 -
/activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java
Author: ningjiang
Date: Fri Nov 7 07:07:09 2008
New Revision: 712148
URL: http://svn.apache.org/viewvc?rev=712148&view=rev
Log:
CAMEL-1018 applied patch with thanks to Balazs
Modified:
activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java
Modified: activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java?rev=712148&r1=712147&r2=712148&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java (original)
+++ activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java Fri Nov 7 07:07:09 2008
@@ -47,6 +47,7 @@
* @version $Revision$
*/
public class HttpProducer extends DefaultProducer<HttpExchange> implements Producer<HttpExchange> {
+ public static final String HTTP_URI = "http.uri";
public static final String HTTP_RESPONSE_CODE = "http.responseCode";
public static final String QUERY = "org.apache.camel.component.http.query";
// This should be a set of lower-case strings
@@ -177,7 +178,11 @@
methodToUse = requestEntity != null ? HttpMethods.POST : HttpMethods.GET;
}
- String uri = ((HttpEndpoint)getEndpoint()).getHttpUri().toString();
+ String uri = exchange.getIn().getHeader(HTTP_URI, String.class);
+ if (uri == null) {
+ uri = ((HttpEndpoint)getEndpoint()).getHttpUri().toString();
+ }
+
HttpMethod method = methodToUse.createMethod(uri);
if (queryString != null) {