Linux 如何手动发出 http/https POST 请求?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15711841/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 22:36:48  来源:igfitidea点击:

How to make http/https POST requests manually?

linuxhttprestpost

提问by neeraj

I want to test some url's on a small custom server i am working on. i have used Wfetch on windows and its awesome

我想在我正在使用的小型自定义服务器上测试一些 url。我在 Windows 上使用过 Wfetch,它很棒

My requirements for these tests are: - should be able to run on linux(ubuntu) - should be able to set all params manually - should support digest aunthentication

我对这些测试的要求是: - 应该能够在 linux(ubuntu) 上运行 - 应该能够手动设置所有参数 - 应该支持摘要验证

can someone suggest some gui or extension for such a work.

有人可以为这样的工作建议一些 gui 或扩展。

I have already tried RESTclient and Poster but they do not support digest aunthentication.

我已经尝试过 RESTclient 和 Poster,但它们不支持摘要验证。

Possible duplicate of How do I manually fire HTTP POST requests with Firefox or Chrome?

可能的重复如何手动触发与Firefox或Chrome HTTP POST请求?

采纳答案by Olaf Dietsche

You can use wgetfor this. From the manualit supports digest authentication and can send POST requests.

您可以wget为此使用。从manual它支持摘要式身份验证并可以发送 POST 请求。

There seems to be a GUI at wget::gui, but I don't know how reliable or complete it is.

wget::gui似乎有一个 GUI ,但我不知道它有多可靠或完整。

回答by Yarkee

wget may help you.

wget 可以帮到你。

get:

得到:

wget http://example.com

post:

邮政:

wget --post-data "username=Yarkee" http://example.com