curl-users
Re: How to intercept curl to extract the raw requests and the raw responses?
Date: Fri, 23 Feb 2018 08:07:21 -0700
You can create a trace file when you issue the curl command. Here is a
simple batch file I am testing to do an HTTP GET. At the end of it is the
reference to dump the session into a Trace file.
@Echo Off
REM Submission URL = %1
REM Return File = %2
REM Trace File = %3
REM User ID:Password = %4
REM Function = %5 (GET)
m:\UP\BFHD\Curl\curl.exe --user %4 --cacert cacert.pem -H "Content-Type:
application/json; charset=utf-8" -H "SOAPAction:" --tlsv1.2 -X %5 %1 -o %2
-v --trace-ascii %3
On Thu, Feb 22, 2018 at 9:32 PM, Keefe Tang <keefe_at_pentagram.me> wrote:
> Yes. You can add the verbose flag -v in your command to see the
> request and response to and from the server.
>
> On Fri, Feb 9, 2018 at 11:30 PM, Peng Yu <pengyu.ut_at_gmail.com> wrote:
> > Hi,
> >
> > In the following example, `curl` should send an HTTP GET request to
> httpbin.org.
> >
> > $ curl -g -sS http://httpbin.org/get
> > {
> > "args": {},
> > "headers": {
> > "Accept": "*/*",
> > "Connection": "close",
> > "Host": "httpbin.org",
> > "User-Agent": "curl/7.57.0"
> > },
> > "origin": "165.91.87.88",
> > "url": "http://httpbin.org/get"
> > }
> >
> > The request probably starts with the following lines and I'd like to
> > see them in the raw request. Is there a way to intercept curl so that
> > I can see the raw requests as well as the raw responses?
> >
> > GET /get HTTP/1.1
> > Host:httpbin.org
> >
> > PS. I tried the following HTTP proxy, but it can not show the raw
> request.
> >
> > https://github.com/abhinavsingh/proxy.py
> >
> > --
> > Regards,
> > Peng
> > -----------------------------------------------------------
> > Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
> > Etiquette: https://curl.haxx.se/mail/etiquette.html
> -----------------------------------------------------------
> Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
> Etiquette: https://curl.haxx.se/mail/etiquette.html
>
-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2018-02-23