What’s new in HTTPie for Terminal 3.0
Tags: httpie, api, testing, cli
Published: 2022-01-26 19:20:16

---
title: What’s new in HTTPie for Terminal 3.0
published: true
description: Nested JSON syntax, plugin manager, response metrics, speed-ups, improved UI/UX, other features, and bug fixes.
tags: httpie, api, testing, cli
---


It’s hard to believe it’s been almost ten years since HTTPie for Terminal’s [initial commit](https://github.com/httpie/httpie/commit/b966efa17d837dc62c23d5f8064e184e22b14c2e). Seeing the result of [scratching our own API itch](https://httpie.io/about) getting adopted by developers across the world and becoming the most popular API tool GitHub with 50K+ stars has been an incredible experience.

Since then, we have been working enthusiastically to provide the best user experience for anyone working with APIs and, as of recently, growing HTTPie into a comprehensive API development platform accessible from Terminal, [Web & Desktop](https://httpie.io/product), and Mobile. Today, we are thrilled to announce the 3.0 release of HTTPie for Terminal.

Our fantastic community has been providing thoughtful feedback over the years. And for 3.0, we focused on some of the most requested features of all time. Let us take you on a tour of the new features 👇

## Summary

**🌲 [Nested JSON](#nested-json) —** HTTPie language extended for crafting complex JSON structures.

**🔌 [Plugin manager](#plugin-manager) —** robust handling of plugin installation.

**⏱️ [Response metadata](#response-metadata) —** a new built-in way to display response metrics.

**🚀 [Speed-ups](#speedups) —** 30–250% speed-ups over different areas.

**🎨 [Improved UI/UX](#improved-uiux) —** [unified Pie theme](#pie-theme), [improved stdin handling](#improved-stdin-handling), and [better errors](#better-errors).

**✨ [Other features](#various-enhancements) —** [bearer auth](#bearer-authentication), [repeated headers](#nonunique-header-names), [prompted session passwords](#prompted-password-in-sessions), [headers & params from files](#query-params-and-headers-from-files), [effortless URL-to-command conversion](#effortless-urltocommand-conversion), [JSON types with forms](#json-types-with-forms), and [auto-streaming](#autostream).

**🪲 [Bug fixes](#bug-fixes) —** extinguished and regression-test-covered.

**❤️ [Community contributions](#community-contributions) —** dozens of amazing people have contributed to making this the best HTTPie release ever.


---

## 🌲 Nested JSON

Have you ever wondered whether the simplicity of the existing [HTTPie request language](https://httpie.io/docs/cli/request-items) could meet with the power of nesting? This was a long journey, but ultimately, we embedded our mini path nesting format into the request language.

We designed it to offer the highest functionality with the best user experience possible. For that, we took an existing format (namely, [HTML JSON form](https://www.w3.org/TR/html-json-forms/)), and built our specification on top of it:

```bash-termible
$ http pie.dev/post \
  platform[name]=HTTPie \
  platform[mission]='Make APIs simple and intuitive' \
  platform[homepage]=httpie.io \
  platform[stars]:=54000 \
  platform[apps][]=Terminal \
  platform[apps][]=Desktop \
  platform[apps][]=Web \
  platform[apps][]=Mobile
```

```json
{
    "platform": {
        "name": "HTTPie",
        "mission": "Make APIs simple and intuitive",
        "homepage": "httpie.io",
        "stars": 54000,
        "apps": [
            "Terminal",
            "Desktop",
            "Web",
            "Mobile"
        ]
    }
}
```

We focused on keeping the experience pleasant even when the user makes errors, which made us treat this as a complete language and implement small productivity boosters all around.

For example, when typing all these structures on the terminal, if you happen to make a typo, not only do we show you where it occurs, but we also tell you how to possibly fix it:

```bash-termible
$ http pie.dev/post data[foo][baar]]baz[:=2
```

```console
HTTPie Syntax Error: Expecting '['
data[foo][baar]]baz[
               ^
```

Another time-saver is object-level type safety, which prevents you from implicitly creating an ill-formatted JSON object:

```bash-termible
$ http pie.dev/post data[foo][bar]=object data[0][baz]="not an array"
```

```console
HTTPie Type Error: Can't perform 'index' based access on 'data' which has a type of 'object' but this operation requires a type of 'array'.
data[0][baz]
    ^^^
```

(If you happen to be a Python developer and these error messages look familiar, it’s because we took inspiration from [improved errors in Python 3.10 / 3.11](https://docs.python.org/dev/whatsnew/3.11.html#enhanced-error-locations-in-tracebacks), that our very own [@isidentical](https://github.com/isidentical) helped bring to life.)

There is a lot more to learn about this feature. We recommend taking a minute familiarizing yourself with it so that your API interactions become more enjoyable than ever.

📖 [Nested JSON docs →](https://httpie.io/docs/cli/nested-json)

## 🔌 Plugin manager


![Plugin manager](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u4iia7lxbwxkro9xg8kf.jpg)

HTTPie shines with plugins, and, even though we never publicized [the plugin API](https://github.com/httpie/httpie/blob/master/httpie/plugins/base.py), developers and companies have written and open-sourced dozens of them.

Their functionality ranges from adding support for different authentication methods to changing how responses are displayed on the terminal; they serve various purposes and offer infinite possibilities to expand HTTPie itself.

For example, [guardian/httpie-hmac-auth](https://github.com/guardian/httpie-hmac-auth) and [akamai/httpie-edgegrid](https://github.com/akamai/httpie-edgegrid) add custom auth protocols to HTTPie, which are then available to you through the `--auth-type` option:

```bash
$ http \
  --auth-type=edgegrid \
  --auth=default: \
  :/diagnostic-tools/v2/ghost-locations/available
```


In the past, however, it was impossible to reliably install plugins for some distribution methods of HTTPie that come with a bundled Python interpreter (e.g., brew and snap).

With 3.0, we make plugins first-class citizens. It is now possible to manage plugins directly by using the new `httpie` management command and its `httpie plugins` subcommands. This interface unifies plugin installation no matter how you installed HTTPie itself:

```bash
$ httpie plugins install your-favorite-plugin
Installing your-favorite-plugin...
[snip]
Installed your-favorite-plugin==1.0.0
```

```bash
$ httpie plugins list
httpie-edgegrid (1.0.6)
  httpie_oauth1 (httpie.plugins.auth.v1)
httpie-image (1.0.0)
  httpie_image (httpie.plugins.converter.v1)
```

If you’re curious what kind of plugins exist, you can [find most of them on PyPI](https://pypi.org/search/?q=httpie-).

📖 [Plugin manager docs →](https://httpie.io/docs/cli/plugin-manager)

## ⏱️ Response metadata

We created a new `meta` section in our universal request/response display format.

The section currently includes the total time elapsed. It’s the number of seconds between opening the network connection and downloading the last byte of the response body.

Surprisingly, this was one of the oldest and [the most 👍’ed issue in our tracker](https://github.com/httpie/httpie/issues/243), and we finally implemented it!

You can use `-vv` to display everything (whole request/response + meta section) or customize this display with our `--print=` option.

```bash-termible
$ http --print=hm pie.dev/delay/0.5
```

```http
HTTP/1.1 200 OK
Content-Type: application/json

Elapsed time: 0.856867s
```

Or only display the meta section with `--meta`.

```bash-termible
$ http --meta pie.dev/delay/1
```

```http
Elapsed time: 0.856867s
```

🐰 By the way, if you use one of the new [Pie theme styles](#improved-ui-ux) (e.g., `--style=pie-dark`), you’ll see the time information color-coded (green/yellow/orange/red) based on how long the exchange took:


![Colorful response time](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t8837qvwznt9gwe3qwpo.png)
📖 [Response meta docs →](https://httpie.io/docs/cli/response-meta)

## 🚀 Speed-ups

We believe that performance is a critical part of the overall user experience. And HTTPie is all about the user and how they feel when using our tools.

HTTPie for Terminal is designed with interactive API communication in mind. In this context, the top priority has always been making active tasks requiring user cognition, such as defining requests and understanding responses, as fast as possible. The human brain’s I/O is a more precious resource than the computer’s one, and the number of brain cells doesn’t double every two years, regrettably.

Having said that, we consider all forms of performance important and are working hard to reduce also the waiting time for developers, and this release includes multiple speed-ups over different areas:


![Speedups](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cfmhm9q540gmhh5t0eqa.png)

- Startup time is now ~30-50% faster (depending on the environment).
- Decoding of streamed responses is ~30% faster.
- Downloads (i.e., when using `--download`) are more than ~2.5× faster — for locally served files, the download speed went from ~320 MB/s to ~680 MB/s.

🐙 [Benchmarking code →](https://github.com/httpie/httpie/tree/master/extras/profiling)

## 🎨 Improved UI/UX

### Pie theme

While we are continuously improving HTTPie for Terminal, it is now part of a bigger platform that brings the beauty and simplicity of HTTPie to [Web & Desktop](https://httpie.io/product), and Mobile. Alongside consistent behavior, we work toward a unified style across these apps. This effort led us to create a new  set of styles called the Pie theme:


![Unified Pie theme](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vvxupgofi8vbxcksz49i.png)

The theme comes in three flavors:

- `pie-dark` — for terminals with dark background
- `pie-light` — for terminals with light background
- `pie` — for both, but slightly compromises text legibility

```bash-termible
$ http -vv --style=pie-dark pie.dev/post hello=world foo:=42
```

While `auto` is still the default style (which takes colors from your shell environment), we highly recommend making `pie-dark` your default style for the best experience:

```bash-termible
$ cat ~/.config/httpie/config.json
```

```json
{
    "default_options": [
        "--style=pie-dark"
    ]
}
```

🐰 Just like the [dynamically colored timings](#response-metadata), we color the HTTP method and status code to match with our apps across the platform. You can try the examples below:

#### Status code colors

These colors are based on the degree of error/recoverability of each status class:

```bash-termible
# 1xx informational – blue
$ http -h pie.dev/status/101
```

```bash-termible
# 2xx successful – green
$ http -h pie.dev/status/200
```

```bash-termible
# 3xx redirection – yellow
$ http -h pie.dev/status/301
```

```bash-termible
# 4xx client error – orange
$ http -h pie.dev/status/400
```

```bash-termible
# 5xx server error – red
$ http -h pie.dev/status/500
```

#### Method colors

These colors are based on the potential severity of the impact of the request:

```bash-termible
# HEAD, GET – green
$ http --print=H GET pie.dev/get
```

```bash-termible
# POST – yellow
$ http --print=H POST pie.dev/post
```

```bash-termible
# PUT, PATCH – orange
$ http --print=H PATCH pie.dev/patch
```


```bash-termible
# DELETE – red
$ http --print=H DELETE pie.dev/delete
```


📖 [Style docs →](https://httpie.io/docs/cli/colors-and-formatting)


### Improved stdin handling

Something that will excite our users who like to use HTTPie for Terminal inside their scripts, workflow definitions, or cron jobs, are our new warnings about when there is no incoming data. If you happen to forget passing `--ignore-stdin`, instead of waiting indefinitely for a stream that will never yield anything, HTTPie will now complain and let you know about this situation.

📖 [Scripting docs →](https://httpie.io/docs/cli/scripting)


### Better errors

We also focused on improving error messages. A typical example is a mistyped hostname:

```bash-termible
$ http this.host.does.not.exist
```

```console
http: error: gaierror: [Errno -2] Name or service not known
Couldn’t resolve the given hostname. Please check the URL and try again.
```

## ✨ Various enhancements


### Bearer authentication

`bearer` is now a natively supported authentication type:

```bash-termible
$ http -A bearer -a token pie.dev/bearer
```

📖 [Bearer auth docs →](https://httpie.io/docs/cli/bearer-auth)

### Non-unique header names

Sending and receiving multiple HTTP header lines with the same name is now fully supported. They’re now shown and sent exactly as specified, i.e., multiple headers lines as opposed to a single header with a comma-separated list of values:

```bash-termible
$ http --offline pie.dev/get X-Pie:Apple X-Pie:Pumpkin
```

```http
GET /get HTTP/1.1
X-Pie: Apple
X-Pie: Pumpkin
```

📖 [Repeated headers docs →](https://httpie.io/docs/cli/multiple-header-values-with-the-same-name)

### Prompted password in sessions

Prompted passwords are now stored in local sessions. Try typing `123` to the given prompt:

```bash-termible
$ http -a user --session=./sess.json pie.dev/basic-auth/user/123
```

And now try without passing the auth option:

```bash-termible
$ http --session=./sess.json pie.dev/basic-auth/user/123
```

Shout out to [Sebastian Czech](https://github.com/sebastianczech) for contributing this feature.

📖 [Password prompt docs →](https://httpie.io/docs/cli/password-prompt)

### Query params and headers from files

There are two new operators for reading query parameters and headers from files — `==@` and `:@`:

```bash-termible
$ http --offline pie.dev/headers \
  Header-From-File:@files/text.txt \
  param-from-file==@files/text.txt
```

📖 [File loading docs →](https://httpie.io/docs/cli/file-based-separators)


### Effortless URL-to-command conversion

Keep `://` in the URL argument if you want to. Pasting URLs into HTTPie calls has never been easier: just add a space after the protocol name:

```bash-termible
$ https ://pie.dev
# => https://pie.dev
```

📖 [URL docs →](https://httpie.io/docs/cli/request-url)

### JSON types with forms

We added support for basic JSON types with `--form` and `--multipart` when using the otherwise JSON-only operators `:=` and `:=@`, which allows you to quickly toggle between form and JSON requests. This change doesn’t alter the existing behavior, but it makes what was previously implicit/undefined/buggy explicitly supported:

```bash-termible
$ http --form pie.dev/post id:=10 'username:="httpie"'
```

📖 [Forms docs →](https://httpie.io/docs/cli/forms)

### Auto-stream

If the response headers include `Content-Type: text/event-stream`, we now auto-stream the response body. So you no longer need to explicitly specify `--stream` when reading event streams.

📖 [Streaming docs →](https://httpie.io/docs/cli/streamed-responses)


## 🪲 Bug fixes

- An XML declaration was auto-added to the beginning of each formatted XML response, but not anymore. Now you'll only see it if it's already present in the raw response.

- Broken plugins would crash the whole application, yikes! They no longer do.

- Automatic syntax highlighting and formatting now works for complex `Content-Type` headers (e.g., when charset is specified).

- Using `--raw` together with `--chunked` is now fixed.

🐙 [Full changelog →](https://github.com/httpie/httpie/blob/master/CHANGELOG.md)

## ❤️ Community contributions

Last but not least we’d like to thank the amazing people who’ve contributed to this phenomenal release of HTTPie:

[Aaron Miller](https://github.com/aaronhmiller), [Alexander Bogdanov](https://github.com/ab-kily), [András Czigány](https://github.com/andrascz), [Batuhan Taskaya](https://github.com/isidentical), [Brad Crittenden](https://github.com/bac), [Chad](https://github.com/cythrawll), [Ed Rooth](https://github.com/sym3tri), [Gabriel Cruz](https://github.com/gmelodie), [Gaurav](https://github.com/gkcs), [Jan Brašna](https://github.com/janbrasna), [Jan Verbeek](https://github.com/blyxxyz), [Jesper Holmberg](https://github.com/strindberg), [Marco Seguri](https://github.com/seguri), [Mark Rosenbaum](https://github.com/markrosenbaum), [Mickaël Schoentgen](https://github.com/BoboTiG), [Mike DePalatis](https://github.com/mivade), [Miro Hrončok](https://github.com/hroncok), [Nanashi.](https://github.com/sevenc-nanashi), [Patrick Taylor](https://github.com/pmeister), [Paul Laffitte](https://github.com/paullaffitte), [Russell Shurts](https://github.com/rshurts), [Sebastian Czech](https://github.com/sebastianczech), [Vivaan Verma](https://github.com/doublevcodes), [Vladimir Berkutov](https://github.com/dair-targ), [arloan](https://github.com/arloan), [blueray453](https://github.com/blueray453), [coldcoff](https://github.com/coldcoff), [hosseingt](https://github.com/hosseingt), [josephworks](https://github.com/josephworks), [peterpt](https://github.com/peterpt), [stonebig](https://github.com/stonebig), [whodidthis](https://github.com/whodidthis), [zoulja](https://github.com/zoulja).

🐙 [How to contribute →](https://github.com/httpie/httpie/blob/master/CONTRIBUTING.md)

## Happy API testing, and see you again soon!

But in the meantime…

- 🎉 [Install the latest version](https://httpie.io/docs/cli/installation) of HTTPie for Terminal.
- 💬 Please [report any bugs](https://github.com/httpie/httpie/issues) and share your feedback on 3.0.
- 🐙️ [Star & watch the GitHub repo](https://github.com/httpie/httpie) to learn about new releases.
- 👉 Join our [Discord community](https://httpie.io/discord) and follow [@httpie](https://twitter.com/httpie) to stay up-to-date.
- 💁🏻‍♀️ [Join the private beta](https://httpie.io/beta) of [HTTPie for Web & Desktop](https://httpie.io/product), if you haven’t yet.
- 👩‍💻 We’re also looking for new colleagues in [engineering and design roles](https://httpie.io/jobs).