制作网站时如何轻松测试POST?
制作网站时测试发送 POST 请求的简单方法是什么?我可以通过在 URL (example.com/?foo=bar&bar=baz
) 中输入 GET 请求来轻松发送 GET 请求,但是发送 POST 请求的同等简单方法是什么?
What's an easy way to test sending POST requests when making a website? I can easily send GET requests by typing it in the URL (example.com/?foo=bar&bar=baz
) but what's an equivalently easy way to send POST requests?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
Curl CLI
或
https://superuser.com /questions/149329/how-do-i-make-a-post-request-with-curl/149335#149335
但我总是只使用带有 http 请求类的测试脚本。我发现您可以在标题、格式、动词等方面获得更精细的粒度。当然,您可以在完成后将该代码放入单元测试中。我使用我编写的这个类( https:// github.com/homer6/altumo/blob/master/source/php/Http/OutgoingHttpRequest.md )但我听说 zend request 类也非常好。
Curl CLI
or
https://superuser.com/questions/149329/how-do-i-make-a-post-request-with-curl/149335#149335
But I always just use a test script with a http request class. I find you get finer granularity over headers, formats, verb, etc. And of course you can put that code into a unit test after you're done. I use this class that I wrote ( https://github.com/homer6/altumo/blob/master/source/php/Http/OutgoingHttpRequest.md ) but I hear that the zend request class is quite good too.
您可以使用 Fiddler 或浏览器插件,例如 FireFox 篡改数据。
或者您可以创建一个表单并从任何 .HTML 页面提交:
You can use Fiddler or a Browser plugin like FireFox Tamper Data.
Or you can just create a form and submit it from any .HTML page:
您可以使用任何检查器来执行此操作,例如 fireFox
make request type post >>输入您的网址>>将参数放入请求正文部分
you can use any inspector to do that like fireFox
make request type post >> put your url >> put parameters in request body section
尝试一些http请求发送工具,例如Wfetch
try some http request sending tools like Wfetch
邮差在 Google Chrome 中,是一个测试 POST 方法的好工具。
Postman in Google Chrome, is a great tool to test POST methods.