You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Karthz <sk...@gmail.com> on 2010/11/02 18:13:22 UTC

Http POST

Hi,

I have been trying to send a Message to a Http Server, using POST method. I
set the message body with the data that the http server expects.

However, since we are using a third-party service, we made a mock of our own
to test it out. For this mock, how do I receive a POST request? Where would
the message body be, in the request I receive? 

I thought the message body would be in the HttpServletRequest object as
attributes, or params, but none of them have what I am looking for.

Any ideas?

Thanks.

-----
- Karthz
-- 
View this message in context: http://camel.465427.n5.nabble.com/Http-POST-tp3247073p3247073.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Http POST

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Post more details such as Camel version used. What components are you using.
And take a look in the unit tests for those components as they most
likely got examples for this.


On Tue, Nov 2, 2010 at 6:13 PM, Karthz <sk...@gmail.com> wrote:
>
> Hi,
>
> I have been trying to send a Message to a Http Server, using POST method. I
> set the message body with the data that the http server expects.
>
> However, since we are using a third-party service, we made a mock of our own
> to test it out. For this mock, how do I receive a POST request? Where would
> the message body be, in the request I receive?
>
> I thought the message body would be in the HttpServletRequest object as
> attributes, or params, but none of them have what I am looking for.
>
> Any ideas?
>
> Thanks.
>
> -----
> - Karthz
> --
> View this message in context: http://camel.465427.n5.nabble.com/Http-POST-tp3247073p3247073.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Http POST

Posted by Willem Jiang <wi...@gmail.com>.
You can take a look at the unit test[1] of camel-jetty[2].
Basically, you can get the message body as an input stream, and you get 
the HttpServletRequest object from the message header with the key 
Exchange.HTTP_SERVLET_REQUEST.

[1]https://svn.apache.org/repos/asf/camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpRouteTest.java

[2]http://camel.apache.org/jetty.html

On 11/3/10 1:13 AM, Karthz wrote:
>
> Hi,
>
> I have been trying to send a Message to a Http Server, using POST method. I
> set the message body with the data that the http server expects.
>
> However, since we are using a third-party service, we made a mock of our own
> to test it out. For this mock, how do I receive a POST request? Where would
> the message body be, in the request I receive?
>
> I thought the message body would be in the HttpServletRequest object as
> attributes, or params, but none of them have what I am looking for.
>
> Any ideas?
>
> Thanks.
>
> -----
> - Karthz


-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang