camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: How to send Query Parameters in POST request along with body?
Date Mon, 15 May 2017 06:03:08 GMT
What Camel version do you use?

And try with latest release and also with camel-http4 instead.

On Sun, May 14, 2017 at 6:02 PM, Sivaraman
<sivaraman_sathyamurthy@intuit.com> wrote:
> Hi,
>
> I'm new to camel and I have to make HTTP POST request with body. Along with
> that, I need to pass url query parameters too
>
> POST https://api.company.com/profile/123?*minorversion=11*
>         <<Profile Payload>> (As body)
>
> I tried setting HTTP_QUERY/HTTP_METHOD in header, but the moment I set
> HTTP_QUERY, camel is firing a GET request.
>
> I tried appending the query param to the URL itself, but still same GET
> request instead of POST.
> Looks like if URL param is set, camel treats the request as GET always.
>
> Any clue on how to make POST request with payload (body) and also query
> parameter?
>
>
> As I read from camel documentation (http://camel.apache.org/http.html) the
> algorithm for GET vs POST is:
>
> The following algorithm is used to determine if either GET or POST HTTP
> method should be used:
> 1. Use method provided in header.
> 2. GET if query string is provided in header.
> 3. GET if endpoint is configured with a query string.
> 4. POST if there is data to send (body is not null).
> 5. GET otherwise.
>
>
> Any help is appreciated.
>
> Thanks,
> Siva
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-send-Query-Parameters-in-POST-request-along-with-body-tp5799486.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Mime
View raw message