Zlatko
Zlatko

Reputation: 19569

How to setup default "Expect" header for curl

Can I setup my (CLI) curl to either not set "Expect: 100-continue" or to set it to "Expect: " for my command-line browsing?

I've ran into this issue with GCE Load balancer returning 502 for curl because it's confused by Expect: 100 and breaks, and now I have to manually set it up on every request. (Well, not manually, I have aliases for the stuff I test frequently, but that's not the point.)

Upvotes: 0

Views: 1940

Answers (1)

Daniel Stenberg
Daniel Stenberg

Reputation: 58004

You can create a ~/.curlrc file and put your default options in that. Described in the man page section for -K, --config.

A default option to switch off the Expect: header could be:

header = "Expect:"

Upvotes: 3

Related Questions