If you’re a Web Developer or DevOps, you probably have to deal with several API systems daily. HTTPie allows you to easily explore APIs before you decide if it’s worth to spend the effort to code a client using a programming language like Python, Ruby, Go, etc.
If you’re not already using HTTPie with Akamai, see this excellent post for instructions: Exploring Akamai APIs from the command line using HTTPie and jq.
Once you’re up and running, open the HTTPie configuration file located at
%APPDATA%\httpie\config.json on Windows).
NOTE: The config directory location can be changed by setting the
HTTPIE_CONFIG_DIR environment variable. To view the exact location run
Edit the Configuration File
To make HTTPie work better with Akamai systems, edit the file to match the following:
"about": "HTTPie configuration file",
The lines in bold text are the default options you can configure. Here’s what they do:
If you installed the
edgegrid package using “git clone https://github.com/akamai-open/httpie-edgegrid.git” (or "pip install httpie-edgegrid" if you have python), you can put the parameter on the config file to have it indicated by default so instead of calls like:
you can run:
By default HTTPie’s timeout is 30 seconds. Unfortunately, some API calls may take over 30s, so it is always good to have a higher timeout.
Allows adding the Akamai debug headers to each HTTPie outgoing request. See "Using Akamai Pragma headers to investigate or troubleshoot Akamai content delivery" for more information about using the Pragma headers.
~/.httpie-custom-headers.json will contain the following:
"Pragma": "akamai-x-cache-on, akamai-x-get-cache-key,
Tells HTTPie to use the default credentials section within .edgerc when no section (-a parameter) is present.