Is is possible to make a cURL request and get the route that is taken (similar to traceroute)

南楼画角 提交于 2021-01-26 03:17:48

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!