1257
votes

I want to test some URLs in a web application I'm working on. For that I would like to manually create HTTP POST requests (meaning I can add whatever parameters I like).

Is there any functionality in Chrome and/or Firefox that I'm missing?

15
Make an AJAX call in the Chrome console. No extension needed. This is a good way to make POST requests without the need to grab authentication cookies. $.post('/resource/path/')FearlessFuture
Whilst an add on is necessary, the close is niitpicking nonsense. He was asking for functionality in chrome or firefox , or iif it needs a plugin. That it might require a specifed or unspecified plugin is not the pointShayne
The post is closed incorrectly. It does not ask for a tool, but for a functionality in the tools the author already is working with. This way we have to close all questions about how to do this or that on some tool - and it will be a good on-tenth of SO.Gangnus
I noticed this feature on Firefox when you open the network tab and choose a random request you can Edit and Resend it which is pretty cool.jurl
In modern browsers you can make use of the Fetch API which lets you do a POST request from the JavaScript developer console with minimal effort. I am prefering this because you don't need to install a third party extension and especially when posting sensitive data (like passwords) it's recommended to NOT rely on external software. Here is a code snippet how to use the Fetch API: gist.github.com/bennyn/ed95ed9edd6ce0d04e7c8d6e6eb1a1f8Benny Neugebauer

15 Answers

2430
votes

I have been making a Chrome app called Postman for this type of stuff. All the other extensions seemed a bit dated so made my own. It also has a bunch of other features which have been helpful for documenting our own API here.


Postman now also has native apps (i.e. standalone) for Windows, Mac and Linux! It is more preferable now to use native apps, read more here.


410
votes

CURL is awesome to do what you want! It's a simple, but effective, command line tool.

REST implementation test commands:

curl -i -X GET http://rest-api.io/items
curl -i -X GET http://rest-api.io/items/5069b47aa892630aae059584
curl -i -X DELETE http://rest-api.io/items/5069b47aa892630aae059584
curl -i -X POST -H 'Content-Type: application/json' -d '{"name": "New item", "year": "2009"}' http://rest-api.io/items
curl -i -X PUT -H 'Content-Type: application/json' -d '{"name": "Updated item", "year": "2010"}' http://rest-api.io/items/5069b47aa892630aae059584
252
votes

Firefox

Open Network panel in Developer Tools by pressing Ctrl+Shift+E or by going Menubar -> Tools -> Web Developer -> Network. Then Click on small door icon on top-right (in expanded form in the screenshot, you'll find it just left of the highlighted Headers), second row (if you don't see it then reload the page) -> Edit and resend whatever request you want

Firefox Dev Tools with button "Edit and Resent" highlighted

POST request body highlighted

176
votes

Forget the browser and try CLI. HTTPie is a great tool!

HTTPie screenshot

CLI HTTP clients:

If you insist on a browser extension then:

Chrome:

Firefox:

46
votes

Having been greatly inspired by Postman for Chrome, I decided to write something similar for Firefox.

REST Easy* is a restartless Firefox add-on that aims to provide as much control as possible over requests. The add-on is still in an experimental state (it hasn't even been reviewed by Mozilla yet) but development is progressing nicely.

The project is open source, so if anyone feels compelled to help with development, that would be awesome: https://github.com/nathan-osman/Rest-Easy

* the add-on available from http://addons.mozilla.org will always be slightly behind the code available on GitHub

22
votes

You specifically asked for "extension or functionality in Chrome and/or Firefox", which the answers you have already received provide, but I do like the simplicity of oezi's answer to the closed question "How can I send a POST request with a web browser?" for simple parameters. oezi says:

With a form, just set method to "post"

<form action="blah.php" method="post">
  <input type="text" name="data" value="mydata" />
  <input type="submit" />
</form>

I.e., build yourself a very simple page to test the POST actions.

18
votes

Here's the Advanced REST Client extension for Chrome.

It works great for me -- do remember that you can still use the debugger with it. The Network pane is particularly useful; it'll give you rendered JSON objects and error pages.

13
votes

For Firefox there is also an extension called RESTClient which is quite nice:

RESTClient, a debugger for RESTful web services

9
votes

It may not be directly related to browsers, but Fiddler is another good software.

Fiddler web debugger

7
votes

I think that Benny Neugebauer's comment on the OP question about the Fetch API should be presented here as an answer since the OP was looking for a functionality in Chrome to manually create HTTP POST requests and that is exactly what the fetch command does.

There is a nice simple example of the Fetch API here:

// Make sure you run it from the domain 'https://jsonplaceholder.typicode.com/'. (cross-origin-policy)
fetch('https://jsonplaceholder.typicode.com/posts',{method: 'POST', headers: {'test': 'TestPost'} })
  .then(response => response.json())
  .then(json => console.log(json))

Some of the advantages of the fetch command are really precious: It's simple, short, fast, available and even as a console command it stored on your chrome console and can be used later.

The simplicity of pressing F12, write the command in the console tab (or press the up key if you used it before) then press Enter, see it pending and returning the response is what making it really useful for simple POST requests tests.

Of course, the main disadvantage here is that, unlike Postman, this won't pass the cross-origin-policy, but still I find it very useful for testing in local environment or other environments where I can enable CORS manually.

4
votes

You could also use Watir or WatiN to automate browsers. Watir is written for Ruby and Watin is for .NET languages. I am not sure if it's what you are looking for, though.

3
votes

Try Runscope. A free tool sampling their service is provided at https://www.hurl.it/.

You can set the method, authentication, headers, parameters, and body. The response shows status code, headers, and body. The response body can be formatted from JSON with a collapsable hierarchy.

Paid accounts can automate test API calls and use return data to build new test calls.

COI disclosure: I have no relationship to Runscope.

2
votes

Check out http-tool for Firefox...

Aimed at web developers who need to debug HTTP requests and responses. Can be extremely useful while developing REST based API.

Features:

  • GET
  • HEAD
  • POST
  • PUT
  • DELETE

Add header(s) to request.
Add body content to request.

View header(s) in response.
View body content in response.
View status code of response.
View status text of response.

2
votes

There have been some other clients born since the rise of Postman that is worth mentioning here:

0
votes

You can post requests directly from the browser with ReqBin. No plugin or desktop application is required.