How do I manually fire HTTP POST requests with Fir

2019-01-02 19:06发布

I want to test some URLs on 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 extension or functionality in Chrome and/or Firefox that I'm missing?

12条回答
孤独寂梦人
2楼-- · 2019-01-02 19:23

Forget browser and try CLI. HTTPie is great tool!

enter image description here

CLI http clients:

If you insist on browser extension then:

Chrome:

Firefox:

查看更多
初与友歌
3楼-- · 2019-01-02 19:24

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.

查看更多
只靠听说
4楼-- · 2019-01-02 19:31

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 to 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.

查看更多
宁负流年不负卿
5楼-- · 2019-01-02 19:31

You could also use Watir or Watin to automate browsers. Watir is written for ruby and Watin is for .Net languages. Not sure if it's what you are looking for though.

查看更多
几人难应
6楼-- · 2019-01-02 19:32

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
查看更多
怪性笑人.
7楼-- · 2019-01-02 19:35

It's a bit ugly, but there's the Simple 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.

查看更多
登录 后发表回答