What’s new in HTTPie 2.5.0
Tags: httpie, api, devtools, cli
Published: 2021-09-15 11:04:04

---
title: What’s new in HTTPie 2.5.0
published: true
description: A new way to pass raw request data as an alternative to piping, XML pretty printing, and improved packaging.
tags: httpie, api, devtools, cli
canonical_url: https://httpie.io/blog/httpie-2.5.0
cover_image: https://httpie.io/Images/Share/blog-httpie-2.5.0.png
---


We’re excited to introduce a new way of passing raw request data as an alternative to piping, XML pretty printing, and improved packaging.


## Raw request data

HTTPie has always used piping as the way to pass [raw request data](/docs#raw-request-body):

```bash
# Standard way to pass raw request body:
$ echo 'Hello, World!' | http pie.dev/post
```

Piping, even though elegant, isn’t always practical, however. When generating API docs examples, invoking HTTPie from a programming language, or writing a complex command on the terminal, it may be easier to use a CLI option instead. That has been an often [requested](https://github.com/httpie/httpie/issues/534) feature.

In this release, we’ve added a new option called `--raw`, and HTTPie treats its value as if it came through `STDIN`. The following command does the same as the one above:

```bash
# New in HTTPie 2.5.0:
$ http --raw='Hello, World!' pie.dev/post
```

## Pretty printing of XML

JSON has been the *lingua franca* of the API world for a while, and HTTPie has always provided [JSON formatting](/docs#terminal-output) for terminal output. Many of our users work with XML as well, though, but XML bodies would be printed as they appear in the HTTP message, often on a single line:

```xml
<?xml version="1.0" encoding="utf-8"?><!-- comment --><root><element key='value'>text</element><element>text</element>tail<empty-element/></root>
```

This release brings formatting to XML (and XHTML) messages as well:

```xml
<?xml version="1.0" encoding="utf-8"?>
<!-- comment -->
<root>
  <element key="value">text</element>
  <element>text</element>
  tail
  <empty-element/>
</root>
```

You can control the formatting behaviour using the following [format options](/docs#format-options):

* Change the default 2-space indent size with `--format-options=xml.indent:4`.
* Turn off XML formatting with `--format-options=xml.format:false`.

## Packaging and distribution

Another theme for this release was improving HTTPie packaging and its availability for different platforms. The following channels have been (or are being) updated or newly added:

* macOS: Homebrew, and MacPorts
* Linux: Snap, Spack, Fedora, RedHat & CentOS via EPEL, Arch, Gentoo, Alpine, Manjaro, OpenSUSE, OpenPKG, and Solus
* Windows: Chocolatey

We want to give a big shout-out to [Miro Hrončok](https://github.com/hroncok), the maintainer of the HTTPie package in Fedora, who has been especially involved and was of great help.  And, of course, we are infinitely thankful to all the other package maintainers working behind the scenes.

## Bug fixes

- Resuming downloads (`--download` with `--continue`) with a single byte to be downloaded left is now fixed ([#1032](https://github.com/httpie/httpie/issues/1032)).
- The behavior of `--verbose` requests with a streamed body when the server returned `307 Temporary Redirect` is now fixed ([#1088](https://github.com/httpie/httpie/issues/1088)).
- The handling of session files with `Cookie:` followed by other headers has been fixed ([#1126](https://github.com/httpie/httpie/issues/1126)).

## Community contributions

We’d like to thank these amazing people for their contributions to this release: [Miro Hrončok](https://github.com/hroncok), [Jan Verbeek](https://github.com/blyxxyz), [Almad](https://github.com/Almad), [nixbytes](https://github.com/nixbytes), [Marcel Stör](https://github.com/marcelstoer), [Jannik Vieten](https://github.com/exploide), [Ilya Sukhanov](https://github.com/IlyaSukhanov), [henryhu712](https://github.com/henryhu712), [Elena Lape](https://github.com/elenalape), [Anton Emelyanov](https://github.com/ainzzorl), [a1346054](https://github.com/a1346054), [bl-ue](https://github.com/bl-ue).

---

Originally published on [HTTPie blog](https://httpie.io/blog/httpie-2.5.0).