SlideShare a Scribd company logo
Scott Leberknight
"HTTPie: a CLI, cURL-like tool for humans"
- httpie.org
"HTTPie is a command line HTTP
client. Its goal is to make CLI
interaction with web services as
human-friendly as possible."
- httpie.org
Implemented in Python
Provides simple http command
Colorized, formatted output
httpie
pip install --upgrade httpie
Installation
or
easy_install httpie
or
yum install httpie
(etc.)
Major Features
colorized output
output formatting
query/form parameters
security (auth, https)
headers
form file uploads
persistent sessions
supports all HTTP verbs
wget-style downloads
streamed responses
Usage
http [flags] [METHOD] URL [REQUEST ITEMS]
3 cool sites to test with:
requestb.in
example.org
httpbin.org
httpie
httpie
httpie
Let's try it...
Hello World
http httpie.org
httpie
-v (verbose)
Defaults...
method - GET
scheme - http://
data fields - JSON
Request Headers
http requestb.in/vnm6qyvn 	
Accept:application/json 	
X-Test-Header:'Foo, Bar'
Name:Value
httpie
URL parameters
name==value
http requestb.in/vnm6qyvn 	
search=='curl vs. httpie' 	
page==2
httpie
Data Fields (JSON)
field=value
field=@file.txt
http requestb.in/vnm6qyvn 	
search='curl vs. httpie' 	
page=2
...httpie will set the method to POST
when a request contains data fields...
httpie
Data Fields (from a file)
http requestb.in/vnm6qyvn 	
data=@/Users/sleberkn/w.txt
httpie
Data Fields (form)
-f, --form
field=value
field=@file.txt
http --form requestb.in/vnm6qyvn 	
search='curl vs. httpie' 	
page=2
...httpie will set the content type
to application/x-www-form-urlencoded
when you use --form ( or -f )...
httpie
Raw JSON
field:=value
field:=@file.txt
http requestb.in/vnm6qyvn 	
terms:='["curl", "vs.", "httpie"]' 	
page:=2
httpie
File Uploads
field@/dir/file_name
http requestb.in/vnm6qyvn 	
the_file@/Users/sleberkn/w.txt
...httpie will set the content type
to multipart/form-data
when you do a file upload...
httpie
Easy as httpie!
HTTP Methods
GET
POST
PUT
PATCH
DELETE
HEAD
(and a few more obscure ones...)
Testing methods with httpbin.org
http GET httpbin.org/get
http POST httpbin.org/post foo=bar
http PUT httpbin.org/put foo=bar
http PATCH httpbin.org/patch foo=bar
http -f DELETE httpbin.org/delete
Authentication
BASIC (default) or Digest
-a,--auth
--auth-type
Has plugins for OAuth & others
Username & password
Username & password prompt
Downloads
-d,--download
-o,--output
http -d -o out.txt httpbin.org/get
httpie
Persistent Sessions
Custom headers, authorization,
and cookies persist between
requests to the same host
Named & anonymous sessions
http --session=user1 	
-a user1:secret 	
example.org 	
X-Thingy:Foo
http --session=user2 	
-a user2:monkey 	
example.org
Named Sessions
Other stuff...
HTTPS support
Supports proxies
Redirect to/from http
Control output via flags
(--headers, --body, --print, etc.)
JSON config file
Scripting support
(via --check-status)
Streaming responses
httpie web site:
httpie.org
(redirects to https://github.com/jkbr/httpie )
References
httpbin HTTP request & response service:
httpbin.org
RequestBin:
requestb.in
My Info
twitter: sleberknight
www.sleberknight.com/blog
scott dot leberknight at gmail.com

More Related Content

PDF
Adyashanti - Az üresség tánca
PDF
E-commerce: the new Magento - OpenERP Connector: a generic connector to any a...
PDF
Metasploit Humla for Beginner
PPT
Practical Malware Analysis: Ch 7: Analyzing Malicious Windows Programs
PDF
SSRF vs. Business-critical applications. XXE tunneling in SAP
PDF
RESTful Web Services with Jersey
PDF
AWS Lambda
PDF
Apache ZooKeeper
Adyashanti - Az üresség tánca
E-commerce: the new Magento - OpenERP Connector: a generic connector to any a...
Metasploit Humla for Beginner
Practical Malware Analysis: Ch 7: Analyzing Malicious Windows Programs
SSRF vs. Business-critical applications. XXE tunneling in SAP
RESTful Web Services with Jersey
AWS Lambda
Apache ZooKeeper

Viewers also liked (20)

PDF
jps & jvmtop
PDF
Dropwizard
PPTX
Zk meetup talk
PPT
Chapter 18 - Distributed Coordination
PDF
Polyglot persistence for Java developers: time to move out of the relational ...
PDF
Polyglot Persistence
PDF
Cloudera Impala, updated for v1.0
PDF
CoffeeScript
PDF
wtf is in Java/JDK/wtf7?
PDF
Cloudera Impala
PDF
Java 8 Lambda Expressions
PDF
HBase Lightning Talk
PDF
Google Guava
PDF
Developing polyglot persistence applications (SpringOne China 2012)
PDF
Developing polyglot persistence applications (gluecon 2013)
PDF
Microservices pattern language (microxchg microxchg2016)
PDF
Awesomizing your Squarespace Website
jps & jvmtop
Dropwizard
Zk meetup talk
Chapter 18 - Distributed Coordination
Polyglot persistence for Java developers: time to move out of the relational ...
Polyglot Persistence
Cloudera Impala, updated for v1.0
CoffeeScript
wtf is in Java/JDK/wtf7?
Cloudera Impala
Java 8 Lambda Expressions
HBase Lightning Talk
Google Guava
Developing polyglot persistence applications (SpringOne China 2012)
Developing polyglot persistence applications (gluecon 2013)
Microservices pattern language (microxchg microxchg2016)
Awesomizing your Squarespace Website
Ad

Similar to httpie (20)

PDF
Python tools for testing web services over HTTP
PDF
Fulfilling the Hypermedia Constraint via HTTP OPTIONS, The HTTP Vocabulary In...
PPT
Http request&response
PPTX
Design Summit - RESTful API Overview - John Hardy
PDF
Talking to Web Services
PPTX
ASP.NET Mvc 4 web api
PDF
Web develop in flask
PDF
HTTP / 1, HTTP / 2 and HTTP / 3: Past, present and the future of APIs
PDF
Web services tutorial
PPT
Introduction to python scrapping
PPTX
Rpi python web
PDF
Web Services Tutorial
PDF
2019 11-bgphp
PPTX
ASP.NET WEB API Training
PPTX
ASP.NET Web API and HTTP Fundamentals
PPTX
11 asp.net web api
PPTX
Gohan
PDF
Rest with Spring
PPTX
From ZERO to REST in an hour
PPT
Http request&response by Vignesh 15 MAR 2014
Python tools for testing web services over HTTP
Fulfilling the Hypermedia Constraint via HTTP OPTIONS, The HTTP Vocabulary In...
Http request&response
Design Summit - RESTful API Overview - John Hardy
Talking to Web Services
ASP.NET Mvc 4 web api
Web develop in flask
HTTP / 1, HTTP / 2 and HTTP / 3: Past, present and the future of APIs
Web services tutorial
Introduction to python scrapping
Rpi python web
Web Services Tutorial
2019 11-bgphp
ASP.NET WEB API Training
ASP.NET Web API and HTTP Fundamentals
11 asp.net web api
Gohan
Rest with Spring
From ZERO to REST in an hour
Http request&response by Vignesh 15 MAR 2014
Ad

More from Scott Leberknight (6)

PDF
JShell & ki
PDF
JUnit Pioneer
PDF
JDKs 10 to 14 (and beyond)
PDF
Unit Testing
PDF
PDF
JShell & ki
JUnit Pioneer
JDKs 10 to 14 (and beyond)
Unit Testing

Recently uploaded (20)

PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
NewMind AI Monthly Chronicles - July 2025
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPT
Teaching material agriculture food technology
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Modernizing your data center with Dell and AMD
PDF
Encapsulation theory and applications.pdf
PPTX
A Presentation on Artificial Intelligence
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
NewMind AI Weekly Chronicles - August'25 Week I
Mobile App Security Testing_ A Comprehensive Guide.pdf
cuic standard and advanced reporting.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Big Data Technologies - Introduction.pptx
Understanding_Digital_Forensics_Presentation.pptx
NewMind AI Monthly Chronicles - July 2025
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Teaching material agriculture food technology
Chapter 3 Spatial Domain Image Processing.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Modernizing your data center with Dell and AMD
Encapsulation theory and applications.pdf
A Presentation on Artificial Intelligence
Network Security Unit 5.pdf for BCA BBA.
Reach Out and Touch Someone: Haptics and Empathic Computing

httpie