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

Claus Ibsen commented on CAMEL-21468:
-------------------------------------

2024-12-11 15:38:40.009 DEBUG 77577 --- [ - timer://yaml] 
org.apache.hc.client5.http.headers       : http-outgoing-0 >> GET /jokes/random 
HTTP/1.1
2024-12-11 15:38:40.009 DEBUG 77577 --- [ - timer://yaml] 
org.apache.hc.client5.http.headers       : http-outgoing-0 >> Accept-Encoding: 
gzip, x-gzip, deflate
2024-12-11 15:38:40.009 DEBUG 77577 --- [ - timer://yaml] 
org.apache.hc.client5.http.headers       : http-outgoing-0 >> Host: 
api.chucknorris.io
2024-12-11 15:38:40.009 DEBUG 77577 --- [ - timer://yaml] 
org.apache.hc.client5.http.headers       : http-outgoing-0 >> Connection: 
keep-alive
2024-12-11 15:38:40.009 DEBUG 77577 --- [ - timer://yaml] 
org.apache.hc.client5.http.headers       : http-outgoing-0 >> User-Agent: 
Apache-HttpClient/5.4.1 (Java/17.0.11)

> camel-http - Add option to log raw request and raw response
> -----------------------------------------------------------
>
>                 Key: CAMEL-21468
>                 URL: https://issues.apache.org/jira/browse/CAMEL-21468
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-http
>    Affects Versions: 4.8.1
>            Reporter: Raymond
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 4.10.0
>
>
> I would like to see the raw request and response in the log when using the 
> http component. For this, the following component options could be added:
> 1. logRawRequest (or showRawRequest)
> 2. logRawResponse (or showRawResponse)
> Now this seems partly possible by setting the log file settings (for example 
> in log4j and logback). However, I often don't have access to these files. I 
> would like to have it similar to debugging in for example Google Chrome or 
> Postman, to quickly enable and disable on the endpoint.
> ----------------------
> Example of a background use case: 
> I have two routes, one with a Groovy script component and one that executes a 
> http call. This works fine when there is a queue between the routes, but not 
> when using a synchronous call with direct. My assumption is that when sending 
> the message to a JMS (ActiveMQ) queue the headers and body objects get 
> automatically converted, for example with a String method. I tried to find 
> out by setting a log component before it and after the http call, however 
> they seem to be the same. Still, one returns 200 and the other 400 
> (unfortunately no other info in the response, except that something is null). 
> Logging and comparing the raw request/response would help me see the 
> difference more easily. In this case setting the log file isn't that easy as 
> the log file is provisioned through terraform/docker and changing it would 
> change it also for other calls. The http endpoint is not reachable locally.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to