<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>command tool Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/command-tool/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Mon, 28 Jan 2019 14:45:00 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.12</generator>
	<item>
		<title>Using HTTPie on Linux</title>
		<link>https://www.osradar.com/using-httpie-on-linux/</link>
					<comments>https://www.osradar.com/using-httpie-on-linux/#respond</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Sun, 27 Jan 2019 02:33:55 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[command tool]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[httpie]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=9833</guid>

					<description><![CDATA[<p>If you are a sysadmin or you are starting to be a sysadmin, it is normal to use the terminal too much. And you know that the terminal is one of the most powerful tools in all of Linux. Recently I showed you the many things that can be done with CURL and we even [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/using-httpie-on-linux/">Using HTTPie on Linux</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>If you are a sysadmin or you are starting to be a sysadmin, it is normal to use the terminal too much. And you know that the terminal is one of the most powerful tools in all of Linux. Recently I showed you the many things that can be done with <a href="https://www.osradar.com/how-to-use-curl-command-linux/" target="_blank" rel="noreferrer noopener" aria-label="CURL (opens in a new tab)">CURL</a> and we even use it a lot in our tutorials. However, there is an application that pretends to be a reliable alternative to CURL. So, in this post, I will tell you about HTTPie. Using HTTPie is simple, you will see.</p>



<p>HTTPie is a <a href="https://httpie.org/" target="_blank" rel="noreferrer noopener" aria-label="command (opens in a new tab)">command</a> line HTTP client with an intuitive UI, JSON support, syntax highlighting, wget-like downloads, plugins, and more. Its goal is to make CLI interaction with web services as human-friendly as possible. In addition, HTTPie can be used for testing, debugging, and generally interacting with HTTP servers.</p>



<p>The mainly features are:</p>



<ul>
<li>Wget-like downloads.</li>
<li>Python 2.7 and 3.x support.</li>
<li>Linux, macOS and Windows support.</li>
<li>Plugins.</li>
<li>Sensible defaults.</li>
<li>Expressive and intuitive command syntax.</li>
<li>Colorized and formatted terminal output.</li>
<li>Built-in JSON support.</li>
<li>Persistent sessions.</li>
<li>Forms and file uploads.</li>
</ul>



<p>So, let us start.</p>



<h2>Installing HTTPie</h2>



<p>HTTPie is an application that is available in the main repositories of most Linux distributions. So, there is no major complication.</p>



<p>If you are using Debian, Ubuntu or derivates:</p>



<pre class="wp-block-preformatted">sudo apt install httpie</pre>



<p>So, in case you are using Fedora:</p>



<pre class="wp-block-preformatted">sudo dnf install httpie</pre>



<p>On CentOS / and RHEL:</p>



<pre class="wp-block-preformatted">sudo yum install httpie</pre>



<p>Finally, if you are using Arch Linux o derivates:</p>



<pre class="wp-block-preformatted">sudo pacman -S httpie</pre>



<figure class="wp-block-image"><img loading="lazy" width="864" height="316" class="wp-image-9835" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/01/1-19.png" alt="Install httpie" srcset="https://www.osradar.com/wp-content/uploads/2019/01/1-19.png 864w, https://www.osradar.com/wp-content/uploads/2019/01/1-19-300x110.png 300w, https://www.osradar.com/wp-content/uploads/2019/01/1-19-768x281.png 768w, https://www.osradar.com/wp-content/uploads/2019/01/1-19-696x255.png 696w" sizes="(max-width: 864px) 100vw, 864px" />
<figcaption>Install httpie</figcaption>
</figure>



<h2>Using HTTPie on Linux</h2>



<p>HTTPie is not complicated to use. On the contrary, its syntax is quite simple to take advantage of. Its syntax is mainly like this:</p>



<pre class="wp-block-preformatted">http [flags] [METHOD] URL [ITEM [ITEM]]</pre>



<p>However, if you run the following command, you will see all the options.</p>



<pre class="wp-block-preformatted">http --help</pre>



<div class="wp-block-image">
<figure class="aligncenter"><img loading="lazy" width="1024" height="576" class="wp-image-9836" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/01/2-20-1024x576.png" alt="Showing the HTTPie help" srcset="https://www.osradar.com/wp-content/uploads/2019/01/2-20-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2019/01/2-20-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2019/01/2-20-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2019/01/2-20-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2019/01/2-20-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2019/01/2-20-747x420.png 747w, https://www.osradar.com/wp-content/uploads/2019/01/2-20.png 1366w" sizes="(max-width: 1024px) 100vw, 1024px" />
<figcaption>Showing the HTTPie help</figcaption>
</figure>
</div>



<p>Let us see some examples.</p>



<h3><strong>Basic usage</strong></h3>



<p>The most basic way to use HTTPie is as follows:</p>



<pre class="wp-block-preformatted">http somepage.com</pre>



<div class="wp-block-image">
<figure class="aligncenter"><img loading="lazy" width="433" height="219" class="wp-image-9837" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/01/3-20.png" alt="Basic usage" srcset="https://www.osradar.com/wp-content/uploads/2019/01/3-20.png 433w, https://www.osradar.com/wp-content/uploads/2019/01/3-20-300x152.png 300w" sizes="(max-width: 433px) 100vw, 433px" />
<figcaption>Basic usage</figcaption>
</figure>
</div>



<p>You can add th -v option to see other information about the site.</p>



<pre class="wp-block-preformatted">http -v somepage.com</pre>



<div class="wp-block-image">
<figure class="aligncenter"><img loading="lazy" width="389" height="157" class="wp-image-9838" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/01/4-22.png" alt="Add a option to the command" srcset="https://www.osradar.com/wp-content/uploads/2019/01/4-22.png 389w, https://www.osradar.com/wp-content/uploads/2019/01/4-22-300x121.png 300w" sizes="(max-width: 389px) 100vw, 389px" />
<figcaption>Add a option to the command</figcaption>
</figure>
</div>



<h3>Download a file with HTTPie</h3>



<p>Similar to CURL with HTTPie it is possible to download a file. For this you can use this command:</p>



<pre class="wp-block-preformatted">http page.com/file &gt; fileo</pre>



<p>Where <em>fileo</em> is the name will be downloaded.</p>



<p>Or you can also use the wget way.</p>



<pre class="wp-block-preformatted">http --download page.com/file</pre>



<div class="wp-block-image">
<figure class="aligncenter"><img loading="lazy" width="1024" height="267" class="wp-image-9839" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/01/5-21-1024x267.png" alt="Download a file using HTTPie" srcset="https://www.osradar.com/wp-content/uploads/2019/01/5-21-1024x267.png 1024w, https://www.osradar.com/wp-content/uploads/2019/01/5-21-300x78.png 300w, https://www.osradar.com/wp-content/uploads/2019/01/5-21-768x200.png 768w, https://www.osradar.com/wp-content/uploads/2019/01/5-21-696x182.png 696w, https://www.osradar.com/wp-content/uploads/2019/01/5-21-1068x279.png 1068w, https://www.osradar.com/wp-content/uploads/2019/01/5-21.png 1365w" sizes="(max-width: 1024px) 100vw, 1024px" />
<figcaption>Download a file using HTTPie</figcaption>
</figure>
</div>



<p>So, this is how to download a file with HTTPie.</p>



<h3>Upload a file</h3>



<p>If you can download a file with HTTPie, obviously you can upload a file.</p>



<pre class="wp-block-preformatted">http example.com &lt; file.odt</pre>



<p>It is a very useful option to interact with servers, even homemade ones.</p>



<h3>Submitting form</h3>



<p>An interesting option is that you can interact with HTML forms. Imagine the possibilities. To do this, run this command.</p>



<pre class="wp-block-preformatted">http -f POST page.com input="value"</pre>



<h3>Basic authentication with HTTPie</h3>



<p>Next, as part of the interaction with servers and applications, you can perform basic authentication from the console with HTTPie.</p>



<pre class="wp-block-preformatted">http -a username:password page.com</pre>



<p>So, that&#8217;s all.</p>



<h2>Conclusion</h2>



<p>It&#8217;s good that sysadmin have CLI tools that facilitate some HTTP interaction processes. Therefore, HTTPie is presented as a great alternative to CURL and that&#8217;s why we win the users.</p>



<p>Please share this post with others.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/using-httpie-on-linux/">Using HTTPie on Linux</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/using-httpie-on-linux/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
