问题
I have a GET request with header params and I want to check which db instance my app is using. Is there a way I could build a cURL request that would tell me where my request is going? I know there is a traceroute
command which displays all the server hops. But is there something similar to that using a cURL?
回答1:
You can use --trace option: --trace FILE Write a debug trace to FILE
curl --trace trace.txt yourdomain.com
(You cannot use trace and verbose at the same time, trace overrides it)
回答2:
For a slightly better formatted output to stdout
curl --trace-ascii - <host>
来源:https://stackoverflow.com/questions/45178804/is-is-possible-to-make-a-curl-request-and-get-the-route-that-is-taken-similar-t