【问题标题】:How to send a GET request with Wget and output it on the screen如何使用 Wget 发送 GET 请求并将其输出到屏幕上
【发布时间】:2021-01-17 10:47:49
【问题描述】:

以下命令使用 Wget 命令成功地将 GET 请求发送到安全服务器,该命令将输出保存在同一目录下的“response_from_API_server.json”文件中。

有没有办法在屏幕上显示命令输出而不是将其保存到文件中?

示例代码:

wget -S --ca-cert=/etc/ssl/AAA.crt 
--certificate=/etc/ssl/BBB.csp-DDD@EEE.cert.pem 
--private-key=/etc/ssl/BBB.csp-DDD@EEE.cert.key.pem 
--header="Accept-Encoding: gzip, deflate"
--header='Accept-Charset: UTF-8'
--header='Content-Type: application/json' -O response_from_API_server.json
--post-data '{"email": "info@mail.com", "accountID": "myaccount1234"}' https: //examplewebsite.com//ourUsers/findAccount

【问题讨论】:

    标签: node.js api post get wget


    【解决方案1】:

    试试-O-,而不是-O response_from_API_server.json。它不会将响应保存到文件中,而是打印到标准输出。

    【讨论】:

    • 太棒了,我认为效果很好! Saving to: ‘STDOUT’ [<=> ] 0 --.-KB/s {"ourUsers":{""accountStatus":"ACTIVE","email":"info@mail.com"} [ <=> ] 252 --.-KB/s in 0s 非常感谢,@dwosk !
    • 很高兴它起作用了 - 你介意把它标记为答案吗?非常感谢
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-22
    • 2018-01-20
    • 1970-01-01
    • 1970-01-01
    • 2020-08-03
    • 1970-01-01
    相关资源
    最近更新 更多