Como posso configurar o cURL para fazer isso por padrão?
Adicione a opção de comando ao arquivo de configuração curl
:
Config file
You can easily end up with curl command lines that use a very large number of command-line options, making them rather hard to work with. Sometimes the length of the command line you want to enter even hits the maximum length your command-line system allows. The Microsoft Windows command prompt being an example of something that has a fairly small maximum line length.
To aid such situations, curl offers a feature we call "config file". It basically allows you to write command-line options in a text file instead and then tell curl to read options from that file in addition to the command line.
...
When curl is invoked, it always (unless -q is used) checks for a default config file and uses it if found. The file name it checks for is
.curlrc
on Unix-like systems and_curlrc
on Windows.The default config file is checked for in the following places in this order:
curl
tries to find the "home directory": It first checks for theCURL_HOME
and then theHOME
environment variables. Failing that, it usesgetpwuid()
on Unix-like systems (which returns the home directory given the current user in your system). On Windows, it then checks for theAPPDATA
variable, or as a last resort the%USERPROFILE%\Application Data
.On Windows, if there is no
_curlrc
file in the home directory, it checks for one in the same directory the curl executable is placed. On Unix-like systems, it will simply try to load.curlrc
from the determined home directory.