SlideShare a Scribd company logo
1 of 47
Download to read offline
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
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
Let's try it...
Hello World
http httpie.org
-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
URL parameters
name==value
http requestb.in/vnm6qyvn 	
search=='curl vs. httpie' 	
page==2
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...
Data Fields (from a file)
http requestb.in/vnm6qyvn 	
data=@/Users/sleberkn/w.txt
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 )...
Raw JSON
field:=value
field:=@file.txt
http requestb.in/vnm6qyvn 	
terms:='["curl", "vs.", "httpie"]' 	
page:=2
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...
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
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

What's hot

Programming Language.ppt
Programming Language.pptProgramming Language.ppt
Programming Language.ppt
Lovely Professional University
 

What's hot (20)

Smart Home Devices
Smart Home DevicesSmart Home Devices
Smart Home Devices
 
Java Ring
Java RingJava Ring
Java Ring
 
Raspberry Pi controlled Home Automation
Raspberry Pi controlled Home AutomationRaspberry Pi controlled Home Automation
Raspberry Pi controlled Home Automation
 
Presentation on IoT Based Home Automation using android & NodeMCU
Presentation on IoT Based Home Automation using android & NodeMCUPresentation on IoT Based Home Automation using android & NodeMCU
Presentation on IoT Based Home Automation using android & NodeMCU
 
SMART HOME AUTOMATION USING MOBILE APPLICATION
SMART HOME AUTOMATION USING MOBILE APPLICATIONSMART HOME AUTOMATION USING MOBILE APPLICATION
SMART HOME AUTOMATION USING MOBILE APPLICATION
 
Home automation using blynk app with fan direction control and displaying sta...
Home automation using blynk app with fan direction control and displaying sta...Home automation using blynk app with fan direction control and displaying sta...
Home automation using blynk app with fan direction control and displaying sta...
 
Smart home with home automation
Smart home with home automationSmart home with home automation
Smart home with home automation
 
Programming Language.ppt
Programming Language.pptProgramming Language.ppt
Programming Language.ppt
 
Home automation system using arduino with android
Home automation system using arduino with androidHome automation system using arduino with android
Home automation system using arduino with android
 
Input device
Input deviceInput device
Input device
 
Smart Home technologies
Smart Home technologiesSmart Home technologies
Smart Home technologies
 
Smart home automation
Smart home automationSmart home automation
Smart home automation
 
Que es word y sus partes
Que es word y sus partes Que es word y sus partes
Que es word y sus partes
 
Home Automation System
Home Automation SystemHome Automation System
Home Automation System
 
The Design of Smart Home
The Design of Smart HomeThe Design of Smart Home
The Design of Smart Home
 
Smarthome
SmarthomeSmarthome
Smarthome
 
Programming with arduino
Programming with arduinoProgramming with arduino
Programming with arduino
 
Home automation
Home automationHome automation
Home automation
 
Home automation voice control
Home automation voice controlHome automation voice control
Home automation voice control
 
Smart home
Smart homeSmart home
Smart home
 

Viewers also liked

Viewers also liked (20)

RESTful Web Services with Jersey
RESTful Web Services with JerseyRESTful Web Services with Jersey
RESTful Web Services with Jersey
 
AWS Lambda
AWS LambdaAWS Lambda
AWS Lambda
 
Apache ZooKeeper
Apache ZooKeeperApache ZooKeeper
Apache ZooKeeper
 
jps & jvmtop
jps & jvmtopjps & jvmtop
jps & jvmtop
 
Dropwizard
DropwizardDropwizard
Dropwizard
 
Zk meetup talk
Zk meetup talkZk meetup talk
Zk meetup talk
 
Chapter 18 - Distributed Coordination
Chapter 18 - Distributed CoordinationChapter 18 - Distributed Coordination
Chapter 18 - Distributed Coordination
 
Polyglot persistence for Java developers: time to move out of the relational ...
Polyglot persistence for Java developers: time to move out of the relational ...Polyglot persistence for Java developers: time to move out of the relational ...
Polyglot persistence for Java developers: time to move out of the relational ...
 
Polyglot Persistence
Polyglot PersistencePolyglot Persistence
Polyglot Persistence
 
Cloudera Impala, updated for v1.0
Cloudera Impala, updated for v1.0Cloudera Impala, updated for v1.0
Cloudera Impala, updated for v1.0
 
Rack
RackRack
Rack
 
CoffeeScript
CoffeeScriptCoffeeScript
CoffeeScript
 
iOS
iOSiOS
iOS
 
wtf is in Java/JDK/wtf7?
wtf is in Java/JDK/wtf7?wtf is in Java/JDK/wtf7?
wtf is in Java/JDK/wtf7?
 
Cloudera Impala
Cloudera ImpalaCloudera Impala
Cloudera Impala
 
Amazon Simple Work Flow Engine (SWF): How Beamr uses SWF for video optimizati...
Amazon Simple Work Flow Engine (SWF): How Beamr uses SWF for video optimizati...Amazon Simple Work Flow Engine (SWF): How Beamr uses SWF for video optimizati...
Amazon Simple Work Flow Engine (SWF): How Beamr uses SWF for video optimizati...
 
Hadoop
HadoopHadoop
Hadoop
 
Java 8 Lambda Expressions
Java 8 Lambda ExpressionsJava 8 Lambda Expressions
Java 8 Lambda Expressions
 
HBase Lightning Talk
HBase Lightning TalkHBase Lightning Talk
HBase Lightning Talk
 
Google Guava
Google GuavaGoogle Guava
Google Guava
 

Similar to httpie

Http request&response by Vignesh 15 MAR 2014
Http request&response by Vignesh 15 MAR 2014Http request&response by Vignesh 15 MAR 2014
Http request&response by Vignesh 15 MAR 2014
Navaneethan Naveen
 

Similar to httpie (20)

Python tools for testing web services over HTTP
Python tools for testing web services over HTTPPython tools for testing web services over HTTP
Python tools for testing web services over HTTP
 
Fulfilling the Hypermedia Constraint via HTTP OPTIONS, The HTTP Vocabulary In...
Fulfilling the Hypermedia Constraint via HTTP OPTIONS, The HTTP Vocabulary In...Fulfilling the Hypermedia Constraint via HTTP OPTIONS, The HTTP Vocabulary In...
Fulfilling the Hypermedia Constraint via HTTP OPTIONS, The HTTP Vocabulary In...
 
Http request&response
Http request&responseHttp request&response
Http request&response
 
Design Summit - RESTful API Overview - John Hardy
Design Summit - RESTful API Overview - John HardyDesign Summit - RESTful API Overview - John Hardy
Design Summit - RESTful API Overview - John Hardy
 
Talking to Web Services
Talking to Web ServicesTalking to Web Services
Talking to Web Services
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web api
 
Web develop in flask
Web develop in flaskWeb develop in flask
Web develop in flask
 
HTTP / 1, HTTP / 2 and HTTP / 3: Past, present and the future of APIs
HTTP / 1, HTTP / 2 and HTTP / 3: Past, present and the future of APIsHTTP / 1, HTTP / 2 and HTTP / 3: Past, present and the future of APIs
HTTP / 1, HTTP / 2 and HTTP / 3: Past, present and the future of APIs
 
Web services tutorial
Web services tutorialWeb services tutorial
Web services tutorial
 
Introduction to python scrapping
Introduction to python scrappingIntroduction to python scrapping
Introduction to python scrapping
 
Rpi python web
Rpi python webRpi python web
Rpi python web
 
Web Services Tutorial
Web Services TutorialWeb Services Tutorial
Web Services Tutorial
 
2019 11-bgphp
2019 11-bgphp2019 11-bgphp
2019 11-bgphp
 
ASP.NET WEB API Training
ASP.NET WEB API TrainingASP.NET WEB API Training
ASP.NET WEB API Training
 
ASP.NET Web API and HTTP Fundamentals
ASP.NET Web API and HTTP FundamentalsASP.NET Web API and HTTP Fundamentals
ASP.NET Web API and HTTP Fundamentals
 
11 asp.net web api
11 asp.net web api11 asp.net web api
11 asp.net web api
 
Gohan
GohanGohan
Gohan
 
Rest with Spring
Rest with SpringRest with Spring
Rest with Spring
 
From ZERO to REST in an hour
From ZERO to REST in an hour From ZERO to REST in an hour
From ZERO to REST in an hour
 
Http request&response by Vignesh 15 MAR 2014
Http request&response by Vignesh 15 MAR 2014Http request&response by Vignesh 15 MAR 2014
Http request&response by Vignesh 15 MAR 2014
 

More from Scott Leberknight

More from Scott Leberknight (6)

JShell & ki
JShell & kiJShell & ki
JShell & ki
 
JUnit Pioneer
JUnit PioneerJUnit Pioneer
JUnit Pioneer
 
JDKs 10 to 14 (and beyond)
JDKs 10 to 14 (and beyond)JDKs 10 to 14 (and beyond)
JDKs 10 to 14 (and beyond)
 
Unit Testing
Unit TestingUnit Testing
Unit Testing
 
SDKMAN!
SDKMAN!SDKMAN!
SDKMAN!
 
JUnit 5
JUnit 5JUnit 5
JUnit 5
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Recently uploaded (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 

httpie