[jira] Created: (CAMEL-877) Access HttpRequest Params from exchange.in.header

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (CAMEL-877) Access HttpRequest Params from exchange.in.header

JIRA jira@apache.org
Access HttpRequest Params from exchange.in.header
-------------------------------------------------

                 Key: CAMEL-877
                 URL: https://issues.apache.org/activemq/browse/CAMEL-877
             Project: Apache Camel
          Issue Type: Improvement
          Components: camel-jetty
    Affects Versions: 1.5.0
         Environment: Windows XP, Java 1.6.0_07
            Reporter: A. Steven Anderson
             Fix For: 1.5.0


Currently, you can only get the http request parameters by using a getHttpRequest() on the HttpExchange and thus you need java code and can't do it from the Spring XML configuration using simple expression language.

e.g. if the request is http://localhost:8080/test?x=1, then the following route should result in 1 being returned in the body of the html response:

<route>
   <from uri="jetty:http://localhost:8080/test" />
   <setBody>
      <simple><html><body>${in.header.x}</body></html></simple>
   </setBody>
   <to uri="mock:end"/>
</route>


--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Work started: (CAMEL-877) Access HttpRequest Params from exchange.in.header

JIRA jira@apache.org

     [ https://issues.apache.org/activemq/browse/CAMEL-877?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Work on CAMEL-877 started by Claus Ibsen.

> Access HttpRequest Params from exchange.in.header
> -------------------------------------------------
>
>                 Key: CAMEL-877
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-877
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-http, camel-jetty
>    Affects Versions: 1.4.0
>         Environment: Windows XP, Java 1.6.0_07
>            Reporter: A. Steven Anderson
>            Assignee: Claus Ibsen
>             Fix For: 1.5.0
>
>   Original Estimate: 1 hour
>  Remaining Estimate: 1 hour
>
> Currently, you can only get the http request parameters by using a getHttpRequest() on the HttpExchange and thus you need java code and can't do it from the Spring XML configuration using simple expression language.
> e.g. if the request is http://localhost:8080/test?x=1, then the following route should result in 1 being returned in the body of the html response:
> <route>
>    <from uri="jetty:http://localhost:8080/test" />
>    <setBody>
>       <simple><html><body>${in.header.x}</body></html></simple>
>    </setBody>
>    <to uri="mock:end"/>
> </route>

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Assigned: (CAMEL-877) Access HttpRequest Params from exchange.in.header

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/activemq/browse/CAMEL-877?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen reassigned CAMEL-877:
---------------------------------

    Assignee: Claus Ibsen

> Access HttpRequest Params from exchange.in.header
> -------------------------------------------------
>
>                 Key: CAMEL-877
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-877
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-http, camel-jetty
>    Affects Versions: 1.4.0
>         Environment: Windows XP, Java 1.6.0_07
>            Reporter: A. Steven Anderson
>            Assignee: Claus Ibsen
>             Fix For: 1.5.0
>
>   Original Estimate: 1 hour
>  Remaining Estimate: 1 hour
>
> Currently, you can only get the http request parameters by using a getHttpRequest() on the HttpExchange and thus you need java code and can't do it from the Spring XML configuration using simple expression language.
> e.g. if the request is http://localhost:8080/test?x=1, then the following route should result in 1 being returned in the body of the html response:
> <route>
>    <from uri="jetty:http://localhost:8080/test" />
>    <setBody>
>       <simple><html><body>${in.header.x}</body></html></simple>
>    </setBody>
>    <to uri="mock:end"/>
> </route>

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (CAMEL-877) Access HttpRequest Params from exchange.in.header

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/activemq/browse/CAMEL-877?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen updated CAMEL-877:
------------------------------

    Affects Version/s: 1.4.0
                           (was: 1.5.0)
          Component/s: camel-http

> Access HttpRequest Params from exchange.in.header
> -------------------------------------------------
>
>                 Key: CAMEL-877
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-877
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-http, camel-jetty
>    Affects Versions: 1.4.0
>         Environment: Windows XP, Java 1.6.0_07
>            Reporter: A. Steven Anderson
>            Assignee: Claus Ibsen
>             Fix For: 1.5.0
>
>   Original Estimate: 1 hour
>  Remaining Estimate: 1 hour
>
> Currently, you can only get the http request parameters by using a getHttpRequest() on the HttpExchange and thus you need java code and can't do it from the Spring XML configuration using simple expression language.
> e.g. if the request is http://localhost:8080/test?x=1, then the following route should result in 1 being returned in the body of the html response:
> <route>
>    <from uri="jetty:http://localhost:8080/test" />
>    <setBody>
>       <simple><html><body>${in.header.x}</body></html></simple>
>    </setBody>
>    <to uri="mock:end"/>
> </route>

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-877) Access HttpRequest Params from exchange.in.header

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/activemq/browse/CAMEL-877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45349#action_45349 ]

Claus Ibsen commented on CAMEL-877:
-----------------------------------

will now add http request parameters to the in header

also the http request headers have moved to a prefix: {{http.request.header.XXX}}
and the http method is also added as: {{http.request.Method}}

so if you send text?x=foo then you can get the header as: ${in.header.x} as the example above.

> Access HttpRequest Params from exchange.in.header
> -------------------------------------------------
>
>                 Key: CAMEL-877
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-877
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-http, camel-jetty
>    Affects Versions: 1.4.0
>         Environment: Windows XP, Java 1.6.0_07
>            Reporter: A. Steven Anderson
>            Assignee: Claus Ibsen
>             Fix For: 1.5.0
>
>   Original Estimate: 1 hour
>  Remaining Estimate: 1 hour
>
> Currently, you can only get the http request parameters by using a getHttpRequest() on the HttpExchange and thus you need java code and can't do it from the Spring XML configuration using simple expression language.
> e.g. if the request is http://localhost:8080/test?x=1, then the following route should result in 1 being returned in the body of the html response:
> <route>
>    <from uri="jetty:http://localhost:8080/test" />
>    <setBody>
>       <simple><html><body>${in.header.x}</body></html></simple>
>    </setBody>
>    <to uri="mock:end"/>
> </route>

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-877) Access HttpRequest Params from exchange.in.header

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/activemq/browse/CAMEL-877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45350#action_45350 ]

Claus Ibsen commented on CAMEL-877:
-----------------------------------

Update wiki with this new feature

> Access HttpRequest Params from exchange.in.header
> -------------------------------------------------
>
>                 Key: CAMEL-877
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-877
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-http, camel-jetty
>    Affects Versions: 1.4.0
>         Environment: Windows XP, Java 1.6.0_07
>            Reporter: A. Steven Anderson
>            Assignee: Claus Ibsen
>             Fix For: 1.5.0
>
>   Original Estimate: 1 hour
>  Remaining Estimate: 1 hour
>
> Currently, you can only get the http request parameters by using a getHttpRequest() on the HttpExchange and thus you need java code and can't do it from the Spring XML configuration using simple expression language.
> e.g. if the request is http://localhost:8080/test?x=1, then the following route should result in 1 being returned in the body of the html response:
> <route>
>    <from uri="jetty:http://localhost:8080/test" />
>    <setBody>
>       <simple><html><body>${in.header.x}</body></html></simple>
>    </setBody>
>    <to uri="mock:end"/>
> </route>

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-877) Access HttpRequest Params from exchange.in.header

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/activemq/browse/CAMEL-877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45351#action_45351 ]

Claus Ibsen commented on CAMEL-877:
-----------------------------------

I am behind a poor firewall at the time so cant commit the code, will do later when at home.

> Access HttpRequest Params from exchange.in.header
> -------------------------------------------------
>
>                 Key: CAMEL-877
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-877
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-http, camel-jetty
>    Affects Versions: 1.4.0
>         Environment: Windows XP, Java 1.6.0_07
>            Reporter: A. Steven Anderson
>            Assignee: Claus Ibsen
>             Fix For: 1.5.0
>
>   Original Estimate: 1 hour
>  Remaining Estimate: 1 hour
>
> Currently, you can only get the http request parameters by using a getHttpRequest() on the HttpExchange and thus you need java code and can't do it from the Spring XML configuration using simple expression language.
> e.g. if the request is http://localhost:8080/test?x=1, then the following route should result in 1 being returned in the body of the html response:
> <route>
>    <from uri="jetty:http://localhost:8080/test" />
>    <setBody>
>       <simple><html><body>${in.header.x}</body></html></simple>
>    </setBody>
>    <to uri="mock:end"/>
> </route>

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-877) Access HttpRequest Params from exchange.in.header

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/activemq/browse/CAMEL-877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45361#action_45361 ]

Claus Ibsen commented on CAMEL-877:
-----------------------------------

Steven, see this unit test that is similar to our route:

https://svn.apache.org/repos/asf/activemq/camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettySteveIssueTest.java

This should be possible in spring xml also

> Access HttpRequest Params from exchange.in.header
> -------------------------------------------------
>
>                 Key: CAMEL-877
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-877
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-http, camel-jetty
>    Affects Versions: 1.4.0
>         Environment: Windows XP, Java 1.6.0_07
>            Reporter: A. Steven Anderson
>            Assignee: Claus Ibsen
>             Fix For: 1.5.0
>
>   Original Estimate: 1 hour
>  Remaining Estimate: 1 hour
>
> Currently, you can only get the http request parameters by using a getHttpRequest() on the HttpExchange and thus you need java code and can't do it from the Spring XML configuration using simple expression language.
> e.g. if the request is http://localhost:8080/test?x=1, then the following route should result in 1 being returned in the body of the html response:
> <route>
>    <from uri="jetty:http://localhost:8080/test" />
>    <setBody>
>       <simple><html><body>${in.header.x}</body></html></simple>
>    </setBody>
>    <to uri="mock:end"/>
> </route>

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Resolved: (CAMEL-877) Access HttpRequest Params from exchange.in.header

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/activemq/browse/CAMEL-877?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-877.
-------------------------------

    Resolution: Fixed

Updated wiki as well.

Steven could you test the 1.5-SNAPSHOT?

> Access HttpRequest Params from exchange.in.header
> -------------------------------------------------
>
>                 Key: CAMEL-877
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-877
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-http, camel-jetty
>    Affects Versions: 1.4.0
>         Environment: Windows XP, Java 1.6.0_07
>            Reporter: A. Steven Anderson
>            Assignee: Claus Ibsen
>             Fix For: 1.5.0
>
>   Original Estimate: 1 hour
>  Remaining Estimate: 1 hour
>
> Currently, you can only get the http request parameters by using a getHttpRequest() on the HttpExchange and thus you need java code and can't do it from the Spring XML configuration using simple expression language.
> e.g. if the request is http://localhost:8080/test?x=1, then the following route should result in 1 being returned in the body of the html response:
> <route>
>    <from uri="jetty:http://localhost:8080/test" />
>    <setBody>
>       <simple><html><body>${in.header.x}</body></html></simple>
>    </setBody>
>    <to uri="mock:end"/>
> </route>

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Reopened: (CAMEL-877) Access HttpRequest Params from exchange.in.header

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/activemq/browse/CAMEL-877?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Willem Jiang reopened CAMEL-877:
--------------------------------

      Assignee: Willem Jiang  (was: Claus Ibsen)

If the request's method is POST,  request.getParameterNames() will parse the post form data.
So we just only set the parameterNames() when we get the GET request.

> Access HttpRequest Params from exchange.in.header
> -------------------------------------------------
>
>                 Key: CAMEL-877
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-877
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-http, camel-jetty
>    Affects Versions: 1.4.0
>         Environment: Windows XP, Java 1.6.0_07
>            Reporter: A. Steven Anderson
>            Assignee: Willem Jiang
>             Fix For: 1.5.0
>
>   Original Estimate: 1 hour
>  Remaining Estimate: 1 hour
>
> Currently, you can only get the http request parameters by using a getHttpRequest() on the HttpExchange and thus you need java code and can't do it from the Spring XML configuration using simple expression language.
> e.g. if the request is http://localhost:8080/test?x=1, then the following route should result in 1 being returned in the body of the html response:
> <route>
>    <from uri="jetty:http://localhost:8080/test" />
>    <setBody>
>       <simple><html><body>${in.header.x}</body></html></simple>
>    </setBody>
>    <to uri="mock:end"/>
> </route>

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Resolved: (CAMEL-877) Access HttpRequest Params from exchange.in.header

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/activemq/browse/CAMEL-877?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Willem Jiang resolved CAMEL-877.
--------------------------------

    Resolution: Fixed

> Access HttpRequest Params from exchange.in.header
> -------------------------------------------------
>
>                 Key: CAMEL-877
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-877
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-http, camel-jetty
>    Affects Versions: 1.4.0
>         Environment: Windows XP, Java 1.6.0_07
>            Reporter: A. Steven Anderson
>            Assignee: Willem Jiang
>             Fix For: 1.5.0
>
>   Original Estimate: 1 hour
>  Remaining Estimate: 1 hour
>
> Currently, you can only get the http request parameters by using a getHttpRequest() on the HttpExchange and thus you need java code and can't do it from the Spring XML configuration using simple expression language.
> e.g. if the request is http://localhost:8080/test?x=1, then the following route should result in 1 being returned in the body of the html response:
> <route>
>    <from uri="jetty:http://localhost:8080/test" />
>    <setBody>
>       <simple><html><body>${in.header.x}</body></html></simple>
>    </setBody>
>    <to uri="mock:end"/>
> </route>

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.