share
Stack OverflowHTTP testing tool, easily send POST/GET/PUT
[+235] [16] nos
[2009-07-06 14:10:21]
[ debugging http testing ]
[ http://stackoverflow.com/questions/1087185/http-testing-tool-easily-send-post-get-put ] [DELETED]

I'm in the need of a tool to help debugging a web application. Is there some simple client tools that allow you to easily send and construct customizable POST [1]/ GET [2]/ PUT [3]/ DELETE [4] HTTP requests?

(4) what OS are you using? - roryf
(3) I like httpie - it is well-documented and easy to use. It is cross-platform (Python) - Colonel Panic
[+187] [2010-02-27 17:59:16] antonj

Some curl examples:

GET

curl -HAccept:text/plain http://example.com/base

PUT

curl -XPUT -HContent-type:text/plain --data "stuff:morestuff" http://example.com/base?param=val

DELETE

curl -XDELETE http://example.com/base/user/123

POST

curl -d "param1=value1&param2=value2" http://example.com/base/

(4) Another curl tip: To send a POST request whose data is not in application/x-www-urlencoded format, use the --data-binary option instead of --data. - Kevin Reid
(8) This is exactly what I needed - kisplit
Looks interesting... must take a look at it - danicotra
for POST with curl use: $ curl -d "lalala[name]=aaaa" -d "lalala[address]=bbbbb" localhost:8888/lalala - Li3ro
1
[+138] [2010-02-27 18:02:04] Nano

hurl.it [1] for those who don't want to download anything

[1] http://hurl.it/

(3) this thing is awesome, thanks man - Garbit
(3) It's an epic thing. - Pateman
this is perfect for simple testing... - PravinCG
Exactly what I was looking for. Even better if you login. - redent84
(3) hurl.it seems to be down. Some web alternatives are apikitchen.com and web-sniffer.net - ryanb
(4) I've put a hurl.it alternative here: hurl.eu - j0k
Great answer! +1 to U - Li3ro
Even great for those who DO want to download something: git clone https://github.com/defunkt/hurl && cd hurl && bundle install && bundle exec shotgun config.ru - Felix Rabe
Perhaps obvious, but note that if you use this you should never put cookie values into an online tool. Doing so is equivalent to giving them your password until you log out. If I were hurl.it, I'd sit around waiting for somebody to put in Paypal and a cookie. - mlissner
After our a recent redesign, Hurl.it no longer retains any data on the server. We definitely don't want to hold on to people's sensitive data. - Runscope API Tools
much easier than reading through the curl manual... sheesh - indienchild
2
[+88] [2009-07-06 14:16:17] Christopher_G_Lewis [ACCEPTED]

For Windows, WFetch [1] is your quick and dirty answer.
Direct download link can be found here [2].

[1] http://support.microsoft.com/kb/284285
[2] http://download.microsoft.com/download/d/e/5/de5351d6-4463-4cc3-a27c-3e2274263c43/wfetch.exe

Just what I needed, thanks. - nos
Is there anything similar for the Mac? - adib
(4) curl works perfectly on the mac - David Sykes
There's a good tool available on the Mac App Store called "RESTTester". Does basic testing for RESTful interfaces. - ing0
@Christopher_G_Lewis it can use but the response are garbled text when the contents are japanese characters. any settings or other tool that can support japanese characters? - eros
I doubt anyone is going to describe WFetch as graceful or elegant, but it does work. Thanks. - james.garriss
A great open source client for OS X: code.google.com/p/cocoa-rest-client - chug2k
For Mac you can try APIKitchen.com. It has a offline version that can run within internal networks - kontinuity
Update link for WFetch: support.microsoft.com/kb/284285 - John B
how to add cookies within it? - khaled annajar
Great! helped me out greatly. - Schlank
3
[+44] [2009-07-06 14:19:37] Damo

RESTClient [1] is a Firefox extension. Also worth looking at is Poster [2] - another extension.

[1] https://addons.mozilla.org/en-US/firefox/addon/9780
[2] https://addons.mozilla.org/en-US/firefox/addon/2691/

anything for chrome? - Adil Malik
I use Chrome now so I use RESTConsole or Advanced REST client. Both are good. - Damo
I found www.hurl.it from an answer posted bellow, that is also good. (platform independent, browser independent and nice user interface) - Adil Malik
4
[+34] [2011-07-07 19:25:38] kontinuity

I absolutely love http://apikitchen.com it is one versatile tool that I have seen for HTTP debugging. They are offering a Mac client for testing within internal networks else you can use their hosted solution with permalinks to share the API output with other developers.


(1) Discovered apikitchen.com and love it! Sleek design with multiple tabs support. - Dayson
(1) I downloaded it to my mac, Great tool! - forhas
(1) Apikitchen fails even when requested server returns HTTP 200. Why? It doesn't say. Unhelpful. EDIT Their new site, Hackst.com succeeds beautifully with response data. Points given back to @kontinuity - SgtPooki
(1) Downloaded the Mac version - Absolutely love this! Thanks for the tip - Tim Dean
requestmaker.com Another similar tool to API Kitchen - Mike R
5
[+29] [2009-07-06 14:14:32] Tamar

Fiddler [1] (free web debugger) allows you to write HTTP requests to webapps.

[1] http://www.fiddler2.com/fiddler2/

from the fiddler website:System Requirements: Windows 2K / XP / 2K3 / Vista / 2K8 / Win7 Microsoft .NET Framework v2.0 or later 8 megabytes disk space / 800mhz processor (Screams at 2.4ghz) 256 megabytes RAM (1GB+ highly recommended) - Sergio Morstabilini
6
[+28] [2012-07-23 19:19:27] JacobusR

I found the Postman plugin [1] for Google Chrome to be very helpful for testing REST interfaces. It can POST, GET, PUT and DELETE, set headers, reply messages, etc.

[1] https://chrome.google.com/webstore/detail/fdmmgilgnpjigdojojpjoooidkmcomcm

(1) I have been using Advanced REST client for a while now and enjoy it! PS, I am adding this as a comment as I can't add it as an answer. - whirlwin
Postman plugin was exactly what I needed: easy to install and handles smoothly requests to local web app (which hurl for example doesn't unless your machine has a public IP address or domain name) - Taoufik Mohdit
7
[+13] [2011-12-16 16:46:34] Shanimal

Some RESTful [1] JSON examples that work on my Mac:

GET (Browse)

curl "http://localhost/myservice/?page=1&size=50"

PUT (Update)

curl -i -X PUT -H Accept:application/json -H Content-Type:application/json  -d '{id:47,user:{firstname:"Joe",lastname:"Smith","phone":"555-555-1212"}}' 'http://localhost/myservice/'

POST (Create)

curl -i -X POST -H Accept:application/json -H Content-Type:application/json  -d '{user:{firstname:"Jane",lastname:"Smith","phone":"555-555-1212","relatedTo":[47]}}' 'http://localhost/myservice/'

DELETE (Remove)

curl -i -X DELETE -H Accept:application/json -H Content-Type:application/json  'http://localhost/myservice/47'
[1] http://en.wikipedia.org/wiki/Representational_state_transfer#RESTful_web_services

8
[+8] [2009-07-06 14:47:23] Tim H

The grandaddy of them all is Telnet [1]. Just open a connection on port 80 and type in the raw commands. Most of the basic Internet protocols, such as HTTP and mail, are text-based and this is part of the reason why.

Of course, if you prefer something more abstract, there are also command-line utilities like Wget [2] and cURL [3].

[1] http://en.wikipedia.org/wiki/Telnet
[2] http://en.wikipedia.org/wiki/Wget
[3] http://en.wikipedia.org/wiki/CURL

telnet + dos (or bash) makes for a fun way to surf the internet - Matthew Whited
9
[+8] [2011-02-16 19:26:18] ia97lies

The best tool to do that is httest [1]. You can get it for Windows or Debian/Ubuntu, just do:

apt-get install httest

httest is also available in source and do run on any Unix System.

To generate a client, write the following script.

CLIENT
_REQ localhost 80
__POST /foo/bar HTTP/1.1
__Host: localhost
__Content-Length: AUTO
__
__my=param&next=foo
_EXPECT . "200 OK"
_WAIT
END

If something is different than 200 OK is returned, the script failed. __POST can be any method like __DELETE or __GET or __FOO

__ is the send command ;)

Run your script with

httest your_script.htt

If you download the newest httest, there are also macros to simplify browser-like requests.

[1] http://htt.sourceforge.net/cgi-bin/cwiki/bin/public

(1) You can get it from sourceforge.net/projects/htt - ia97lies
10
[+6] [2010-02-27 17:24:49] Orhan Cinar

Firefox add-on Tamper Data [1].

[1] https://addons.mozilla.org/firefox/addon/966

11
[+5] [2009-07-06 14:57:23] Nir Levy

Wget [1] is very versatile. TIP: use wget -d to get full debugging information about the request and response.

[1] http://en.wikipedia.org/wiki/Wget

12
[+4] [2010-03-01 10:39:07] Arjan

For non-automated testing, the Live HTTP Headers [1] add-on for Firefox can be used to alter and replay requests. (It can also change the request method; though the request method dropdown only shows GET and POST, one can actually type whatever one likes, even invalid methods. One could also type the whole request payload, but I assume the other answers offer better solutions for that.)

The online Web-Sniffer [2] might be useful to see a response [3] without rendering it.

(The Web Developer Toolbar [4] can easily change the method attribute in a <form> itself, which after submitting once might make it easy to change request parameters, in some limited cases. One can achieve the same with any tool like Firebug or Web Inspector.)

[1] https://addons.mozilla.org/firefox/addon/3829
[2] http://web-sniffer.net/
[3] http://web-sniffer.net/?url=http%3A%2F%2Fstackoverflow.com&http=1.1&gzip=yes&type=GET&uak=0
[4] https://addons.mozilla.org/en-US/firefox/addon/60?src=fxcustomization

+1 for the thought put in - james_womack
13
[+3] [2010-08-06 03:45:47] DocD

User adib mentioned a utility for the Mac. I've been using HTTP Client [1] and have had no problems with it at all. It supports GET [2], POST [3], PUT, DELETE, TRACE, OPTIONS, HEAD, and CONNECT.

I hope that helps :)

[1] http://ditchnet.org/httpclient/
[2] http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods
[3] http://en.wikipedia.org/wiki/POST_%28HTTP%29

14
[+2] [2010-03-04 19:41:37] user281446

The Burp proxy tool [1] is easy to use. It is external to the browser which is nice. Some of the other tools that integrate into the browser as a plug-in have advantages too.

You can see all HTTP [2]/ HTTPS [3] requests and responses and edit them if desired.

[1] http://en.wikipedia.org/wiki/Burp_suite#Proxy_server
[2] http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol
[3] http://en.wikipedia.org/wiki/HTTP_Secure

15
[0] [2010-11-26 14:15:24] user515355

Here is my tool, OWASP HTTP Post Tool [1].

[1] http://www.owasp.org/index.php/OWASP_HTTP_Post_Tool

16