Config
HTTPie uses a simple config.json
file. The file doesn’t exist by defaultbut you can create it manually.
Config file directory
The default location of the configuration file is ~/.httpie/config.json
(or %APPDATA%\httpie\config.json
on Windows).
The config directory can be changed by setting the $HTTPIE_CONFIG_DIR
environment variable:
- $ export HTTPIE_CONFIG_DIR=/tmp/httpie
- $ http example.org
To view the exact location run http —debug
.
Configurable options
Currently HTTPie offers a single configurable option:
default_options
An Array
(by default empty) of default options that should be applied toevery invocation of HTTPie.
For instance, you can use this config option to change your default color theme:
- $ cat ~/.httpie/config.json
- {
- "default_options": [
- "--style=fruity"
- ]
- }
Even though it is technically possible to include there any of HTTPie’soptions, it is not recommended to modify the default behaviour in a waythat would break your compatibility with the wider world as that cangenerate a lot of confusion.
Un-setting previously specified options
Default options from the config file, or specified any other way,can be unset for a particular invocation via —no-OPTION
arguments passedon the command line (e.g., —no-style
or —no-session
).