How to setup default “Expect” header for curl

徘徊边缘 提交于 2019-12-12 04:29:55

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!