Hi Claus,
HttpProduce -- from camel-http4 library is setting the content-type
'text/plain' in method [1] line # 488 (camel version 2.16.3) even though we
have set the Content-Type to be NULL - This is NOT the case with HttpProducer -
from camel-http library.
By enabling the apache commons log, the headers are clearly visible.
The end-system we are invoking throws '415' due to the wrong Content Type
passed and if we DO NOT pass any content type it works. As at execution time we
can't determine the Content-Type, we want to pass it NULL.
Any possible way to achieve not sending of Content-Type header?
2017/04/04 00:48:55:618 CEST [DEBUG] headers - http-outgoing-0 >> POST
/service/scim/Users HTTP/1.1
2017/04/04 00:48:55:618 CEST [DEBUG] headers - http-outgoing-0 >> breadcrumbId:
ID-i044312-33503-1491259732621-0-1
2017/04/04 00:48:55:618 CEST [DEBUG] headers - http-outgoing-0 >>
Content-Length: 518
2017/04/04 00:48:55:618 CEST [DEBUG] headers - http-outgoing-0 >> Content-Type:
text/plain ---- in this
line.
2017/04/04 00:48:55:618 CEST [DEBUG] headers - http-outgoing-0 >> Host: xxxxxxx
2017/04/04 00:48:55:618 CEST [DEBUG] headers - http-outgoing-0 >> Connection:
Keep-Alive
2017/04/04 00:48:55:618 CEST [DEBUG] headers - http-outgoing-0 >> User-Agent:
Apache-HttpClient/4.5.2 (Java/1.7.0_101)
2017/04/04 00:48:55:618 CEST [DEBUG] headers - http-outgoing-0 >>
Accept-Encoding: gzip,deflate
2017/04/04 00:48:55:618 CEST [DEBUG] headers - http-outgoing-0 >>
Authorization: Basic XXXXXXXX
2017/04/04 00:48:55:619 CEST [DEBUG] wire - http-outgoing-0 >> "POST
/service/scim/Users HTTP/1.1[\r][\n]"
2017/04/04 00:48:55:619 CEST [DEBUG] wire - http-outgoing-0 >> "breadcrumbId:
ID-i044312-33503-1491259732621-0-1[\r][\n]"
2017/04/04 00:48:55:619 CEST [DEBUG] wire - http-outgoing-0 >> "Content-Length:
518[\r][\n]"
2017/04/04 00:48:55:619 CEST [DEBUG] wire - http-outgoing-0 >> "Content-Type:
text/plain[\r][\n]" --- in this
line
2017/04/04 00:48:55:619 CEST [DEBUG] wire - http-outgoing-0 >> "Host:
xxxxxxxxx[\r][\n]"
2017/04/04 00:48:55:619 CEST [DEBUG] wire - http-outgoing-0 >> "Connection:
Keep-Alive[\r][\n]"
2017/04/04 00:48:55:619 CEST [DEBUG] wire - http-outgoing-0 >> "User-Agent:
Apache-HttpClient/4.5.2 (Java/1.7.0_101)[\r][\n]"
2017/04/04 00:48:55:619 CEST [DEBUG] wire - http-outgoing-0 >>
"Accept-Encoding: gzip,deflate[\r][\n]"
2017/04/04 00:48:55:619 CEST [DEBUG] wire - http-outgoing-0 >> "Authorization:
Basic XXXXXXXX[\r][\n]"
2017/04/04 00:48:55:619 CEST [DEBUG] wire - http-outgoing-0 >> "[\r][\n]"
2017/04/04 00:48:55:619 CEST [DEBUG] wire - http-outgoing-0 >> "{[\r][\n]"
2017/04/04 00:48:55:620 CEST [DEBUG] wire - http-outgoing-0 >> "}"
[1] -
org.apache.camel.component.http4.HttpProducer.createRequestEntity(Exchange)
Regards,
Arpit.
-----Original Message-----
From: souciance [mailto:[email protected]]
Sent: Thursday, February 9, 2017 1:40 PM
To: [email protected]
Subject: Re: Camel Http vs Camel Http4 - Content Type Header
Well it should be pretty easy to setup a http server and see what headers
your route are sending and compare that to what the actual server wants. If
camel-http4 is suppressing some headers then perhaps try another component.
On Thu, Feb 9, 2017 at 10:32 PM, Goyal, Arpit [via Camel] <
[email protected]> wrote:
> Hi,
>
> We were on Camel-Http (2.16) and moving to Camel-Http4 (2.16) and saw that
> URL which worked with Camel-http now fails with Camel-Http4 with status
> code - 415 (Unsupported Media Type).
>
> Caused by: org.apache.camel.http.common.HttpOperationFailedException:
> HTTP operation failed invoking https://<host>:<port>/
> myservice/Users?authMethod=Basic with statusCode: 415
>
> Saw this discussion on Nabble - http://camel.465427.n5.nabble.
> com/Http4-Set-Header-Content-Type-not-passing-through-to-
> the-HTTP-Request-td5746414.html#a5752856
>
> Does this mean we CAN"T USE - Camel-HTTP4 ?
>
> Regards,
> Arpit.
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/Camel-Http-vs-Camel-Http4-
> Content-Type-Header-tp5793736.html
> To start a new topic under Camel - Users, email
> [email protected]
> To unsubscribe from Camel - Users, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=c291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpbC5jb218NDY1NDI4fDE1MzI5MTE2NTY=>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
--
View this message in context:
http://camel.465427.n5.nabble.com/Camel-Http-vs-Camel-Http4-Content-Type-Header-tp5793736p5793737.html
Sent from the Camel - Users mailing list archive at Nabble.com.