Skip to content

Add skip_headers argument#27

Open
ArtyomKomarenko wants to merge 1 commit into
ofw:masterfrom
ArtyomKomarenko:skip-headers
Open

Add skip_headers argument#27
ArtyomKomarenko wants to merge 1 commit into
ofw:masterfrom
ArtyomKomarenko:skip-headers

Conversation

@ArtyomKomarenko

@ArtyomKomarenko ArtyomKomarenko commented Oct 13, 2021

Copy link
Copy Markdown

By default returned string contains all headers including auto-generated ['accept', 'accept-encoding', 'connection', 'user-agent', 'content-length']. But these headers are not necessary to execute request by curl in terminal, and sometimes they can obstruct it execution. To avoid that case skip_headers=True can be passed to to_curl method.

@ofw

ofw commented May 25, 2025

Copy link
Copy Markdown
Owner

Hi! If you think that this change is still relevant please rebase it onto the main branch.

Also I'd suggest to provide the skip_headers param to the to_curl function for any users to be able to skip any list of headers not the hardcoded ones.

@dlenski

dlenski commented May 5, 2026

Copy link
Copy Markdown

But these headers are not necessary to execute request by curl in terminal

That's entirely server- and application-dependent. Some HTTP servers and applications may not care about these headers, but others will.

If you just want a shorter, more humanly-readable curl command line where it's 100% equivalent (according to standard HTTP semantics like header case insensitivity), see #38.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants