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_DIRenvironment variable:

  1. $ export HTTPIE_CONFIG_DIR=/tmp/httpie
  2. $ 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:

  1. $ cat ~/.httpie/config.json
  1. {
  2. "default_options": [
  3. "--style=fruity"
  4. ]
  5. }

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).