问题
I'm working on a flow that includes an <http:request>
element, but I keep getting unexpected 404 responses. Is there a way for me to check the actual URL that is being requested?
I can't see any way to do this within Mule. I also tried using Fiddler as a proxy but can't get any sessions to show up in Fiddler for the requests starting from Mule.
回答1:
You can use a proxy like CharlesProxy: http://www.charlesproxy.com/ or something but you can also just use log4j. If you try adding this to your log4j2 configuration:
<AsyncLogger name="org.glassfish.grizzly" level="DEBUG" />
<AsyncLogger name="org.asynchttpclient" level="DEBUG" />
<AsyncLogger name="com.ning.http" level="DEBUG" />
For a HTTP request using the http:request to http://google.com, it logs the following:
DEBUG 2015-07-14 13:18:17,416 [[test].test.worker.01] com.ning.http.client.providers.grizzly.GrizzlyConnectionsPool: [poll] No existing queue for uri [http://google.com:80]. DEBUG 2015-07-14 13:18:17,449 [[test].http.requester.httprequest(1) SelectorRunner] com.ning.http.client.providers.grizzly.GrizzlyAsyncHttpProvider: REQUEST: HttpRequestPacket ( method=GET url=/ query=null protocol=HTTP/1.1 content-length=-1 headers=[ Host=google.com:80 Connection=keep-alive Accept=/ User-Agent=NING/1.0] )
回答2:
If you're on MAC, you could try Wireshark. Fiddler does not indeed capture the HTTP request from Mule, from my experience as well.
来源:https://stackoverflow.com/questions/31394590/check-actual-url-used-for-request-in-mule-http-connector