Discussion:
curl + some proxy -- to generate the request/response headers
bruce
2018-07-15 15:34:43 UTC
Permalink
Hi.

Trying to figure out the best/quickest approach to using curl +
cmdline (centos) to generate the request/response headers for a target
url.

curl -v -L 'foo'

generates the response headers.

As far as I can tell, using a "proxy" server should allow me to then
view the har data for the url which would have the complete
request/response headers for the target url.

If you have a good site/pointers on how to accomplish this, let me know.

thanks
-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-user
Daniel Stenberg
2018-07-16 22:41:18 UTC
Permalink
Post by bruce
curl -v -L 'foo'
generates the response headers.
As far as I can tell, using a "proxy" server should allow me to then view
the har data for the url which would have the complete request/response
headers for the target url.
Sure, or you can just use curl's --trace-ascii option and get a full trace of
the entire request response from curl's perspective.
Post by bruce
If you have a good site/pointers on how to accomplish this, let me know.
1. Install and run a HTTP proxy
2. Make sure the proxy logs all the details you want
3. point curl to use it by adding "-x myproxy:12345" to the command line
4. Watch your proxy's log

Note that this proxy approch will not work with HTTPS urls without some
additional hackery.
--
/ daniel.haxx.se
-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etique
Loading...