<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mickaël Schoentgen</title>
    <description>The latest articles on DEV Community by Mickaël Schoentgen (@__tiger222__).</description>
    <link>https://dev.to/__tiger222__</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F704972%2F601ee6e3-753a-4455-8e4b-efdf3f271608.jpeg</url>
      <title>DEV Community: Mickaël Schoentgen</title>
      <link>https://dev.to/__tiger222__</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/__tiger222__"/>
    <language>en</language>
    <item>
      <title>What’s new in HTTPie 2.5.0</title>
      <dc:creator>Mickaël Schoentgen</dc:creator>
      <pubDate>Wed, 15 Sep 2021 11:04:04 +0000</pubDate>
      <link>https://dev.to/pie/what-s-new-in-httpie-2-5-0-b99</link>
      <guid>https://dev.to/pie/what-s-new-in-httpie-2-5-0-b99</guid>
      <description>&lt;p&gt;We’re excited to introduce a new way of passing raw request data as an alternative to piping, XML pretty printing, and improved packaging.&lt;/p&gt;

&lt;h2&gt;
  
  
  Raw request data
&lt;/h2&gt;

&lt;p&gt;HTTPie has always used piping as the way to pass &lt;a href="https://dev.to/docs#raw-request-body"&gt;raw request data&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Standard way to pass raw request body:&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s1"&gt;'Hello, World!'&lt;/span&gt; | http pie.dev/post
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;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 &lt;a href="https://github.com/httpie/httpie/issues/534"&gt;requested&lt;/a&gt; feature.&lt;/p&gt;

&lt;p&gt;In this release, we’ve added a new option called &lt;code&gt;--raw&lt;/code&gt;, and HTTPie treats its value as if it came through &lt;code&gt;STDIN&lt;/code&gt;. The following command does the same as the one above:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# New in HTTPie 2.5.0:&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;http &lt;span class="nt"&gt;--raw&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'Hello, World!'&lt;/span&gt; pie.dev/post
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Pretty printing of XML
&lt;/h2&gt;

&lt;p&gt;JSON has been the &lt;em&gt;lingua franca&lt;/em&gt; of the API world for a while, and HTTPie has always provided &lt;a href="https://dev.to/docs#terminal-output"&gt;JSON formatting&lt;/a&gt; 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:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;/span&gt;&lt;span class="c"&gt;&amp;lt;!-- comment --&amp;gt;&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;root&amp;gt;&amp;lt;element&lt;/span&gt; &lt;span class="na"&gt;key=&lt;/span&gt;&lt;span class="s"&gt;'value'&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;text&lt;span class="nt"&gt;&amp;lt;/element&amp;gt;&amp;lt;element&amp;gt;&lt;/span&gt;text&lt;span class="nt"&gt;&amp;lt;/element&amp;gt;&lt;/span&gt;tail&lt;span class="nt"&gt;&amp;lt;empty-element/&amp;gt;&amp;lt;/root&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This release brings formatting to XML (and XHTML) messages as well:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;/span&gt;
&lt;span class="c"&gt;&amp;lt;!-- comment --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;root&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;element&lt;/span&gt; &lt;span class="na"&gt;key=&lt;/span&gt;&lt;span class="s"&gt;"value"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;text&lt;span class="nt"&gt;&amp;lt;/element&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;element&amp;gt;&lt;/span&gt;text&lt;span class="nt"&gt;&amp;lt;/element&amp;gt;&lt;/span&gt;
  tail
  &lt;span class="nt"&gt;&amp;lt;empty-element/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/root&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can control the formatting behaviour using the following &lt;a href="https://dev.to/docs#format-options"&gt;format options&lt;/a&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Change the default 2-space indent size with &lt;code&gt;--format-options=xml.indent:4&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Turn off XML formatting with &lt;code&gt;--format-options=xml.format:false&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Packaging and distribution
&lt;/h2&gt;

&lt;p&gt;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:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;macOS: Homebrew, and MacPorts&lt;/li&gt;
&lt;li&gt;Linux: Snap, Spack, Fedora, RedHat &amp;amp; CentOS via EPEL, Arch, Gentoo, Alpine, Manjaro, OpenSUSE, OpenPKG, and Solus&lt;/li&gt;
&lt;li&gt;Windows: Chocolatey&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We want to give a big shout-out to &lt;a href="https://github.com/hroncok"&gt;Miro Hrončok&lt;/a&gt;, 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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bug fixes
&lt;/h2&gt;

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

&lt;h2&gt;
  
  
  Community contributions
&lt;/h2&gt;

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




&lt;p&gt;Originally published on &lt;a href="https://httpie.io/blog/httpie-2.5.0"&gt;HTTPie blog&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>httpie</category>
      <category>api</category>
      <category>devtools</category>
      <category>cli</category>
    </item>
  </channel>
</rss>
