Curl - Include option from a file using the -K or --config option

by
Jeremy Canfield |
Updated: June 24 2022
| Curl articles
Some curl commands can contain quite a few command line options. For example, let's say you have the following curl command, which is using the --insecure flag to ignore SSL warnings, the --silent flag to hide the progress bar, and the --request GET option to issue a GET request to https://www.example.com/api.
curl --insecure --silent --request GET --url https://www.example.com/api
The options and flags can be stored in a configuration file. For example, let's say a file named curl.config contains the following.
--insecure --silent --request GET
You can then use the -K or --config option to include the curl.config file.
curl --config curl.config --url https://www.example.com/api
Did you find this article helpful?
If so, consider buying me a coffee over at