Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request (outbound) headers not shown with -i option #1704

Closed
olesteban opened this issue Jul 27, 2017 · 3 comments
Closed

Request (outbound) headers not shown with -i option #1704

olesteban opened this issue Jul 27, 2017 · 3 comments

Comments

@olesteban
Copy link

Sample request:

C:>curl.exe -i https://ec.haxx.se/http-requests.html -s
HTTP/2 200
age: 619
content-encoding: identity
content-type: text/html
...

If I use the --trace-ascii option, in the file I can find

=> Send header, 90 bytes (0x5a)
0000: GET /http-requests.html HTTP/2
0020: Host: ec.haxx.se
0032: User-Agent: curl/7.54.1
004b: Accept: */*
0058:

Expected

I expected these lines also in stdout. I'd say they appear in linux (I don't have a linux machine right now to say). To be honest, my idea of this behavior in linux didn't include httpS, so this could be the cause.

Well, using plain http in Windows results in the same output:

C:>curl.exe -i http://www.curlpp.org/  -s
HTTP/1.1 200 OK
Server: GitHub.com
Content-Type: text/html; charset=utf-8
Last-Modified: Fri, 05 May 2017 05:25:58 GMT
...

curl/libcurl version

C:>curl.exe -V
curl 7.54.1 (x86_64-pc-win32) libcurl/7.54.1 OpenSSL/1.1.0f zlib/1.2.11 WinIDN libssh2/1.8.0 nghttp2/1.24.0
Release-Date: 2017-06-14
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile SSPI Kerberos SPNEGO NTLM SSL libz TLS-SRP HTTP2 HTTPS-proxy

operating system

Windows 10 Pro v1607 64 bits

@bagder
Copy link
Member

bagder commented Jul 27, 2017

-i is for showing the response headers to the same output destination as the body. It doesn't not mean you'll see the outgoing request. To see the request, use -v or one of the --trace* options.

@jay
Copy link
Member

jay commented Jul 27, 2017

What do you think about changing the doc to: Include the response HTTP-header in the output.

@bagder bagder closed this as completed in 171f8de Jul 28, 2017
@bagder
Copy link
Member

bagder commented Jul 28, 2017

Thanks, both of you!

jay added a commit that referenced this issue Jul 29, 2017
@lock lock bot locked as resolved and limited conversation to collaborators May 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

3 participants