问题
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.)
回答1:
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:"
来源:https://stackoverflow.com/questions/41045248/how-to-setup-default-expect-header-for-curl