How to easily test POST when building a website?

What is an easy way to verify sending POST requests when building a website? I can easily send GET requests by typing it in the url ( example.com/?foo=bar&bar=baz ), but what's the easy way to send POST requests?

+4
source share
5 answers

You can use the Fiddler or Browser plugin, for example FireFox Tamper Data .

Or you can simply create a form and submit it from any .HTML page:

 <form action="TestPage.html" method="POST"> <input name="name1" value="value1" /> <input name="name2" value="value2" /> <input type="submit" value="POST!" /> </form> 
+5
source

Curl CLI

 curl -d "param1=value&param2=value2" http://www.example.com/resource 

or

 curl -F " fileupload=@filename.txt " http://www.example.com/resource 

https://superuser.com/questions/149329/how-do-i-make-a-post-request-with-curl/149335#149335

But I always use a test script with the http request class. I find that you get finer granularity in headings, formats, verb, etc. And of course, you can put this code in unit test after you are done. I use this class that I wrote ( https://github.com/homer6/altumo/blob/master/source/php/Http/OutgoingHttpRequest.md ), but I heard that the zend request class is good too.

+9
source

try some HTTP request sending tools like Wfetch

0
source

Postman on Google Chrome is a great tool for testing POST methods.

0
source

you can use any inspector for this, for example fireFox

enter the request type post -> put your url -> put the parameters in the request body section

enter image description here

0
source

All Articles