【发布时间】:2018-03-22 05:49:39
【问题描述】:
我有这个 curl 命令:
curl -k -d . -o SessionRequest.txt
"https://myserver.com/MyWebApi/user?companysn=1234&login=my_login&password=my_password&ApiKey=my_api_key"
-d . 代表什么?它有什么作用?
【问题讨论】:
标签: curl
我有这个 curl 命令:
curl -k -d . -o SessionRequest.txt
"https://myserver.com/MyWebApi/user?companysn=1234&login=my_login&password=my_password&ApiKey=my_api_key"
-d . 代表什么?它有什么作用?
【问题讨论】:
标签: curl
如果您有任何疑问,请使用man。
发出man curl 并阅读有关-d 开关的信息。
-d, --data <data>
(HTTP) Sends the specified data in a POST request to the HTTP
cause curl to pass the data to the server using the content-type
-d, --data is the same as --data-ascii. --data-raw is almost the
ter. To post data purely binary, you should instead use the
[...]
它允许您发送 ASCII 数据,例如:
curl -d '{"hello": "world"}' -X POST -H "Content-Type: application/json" https://example.com
向服务器发送一个 JSON 字符串。
在您的示例中,它只是将 . 字符作为 ASCII 数据发送到服务器。它的作用取决于服务器逻辑,并且超出了curl 命令范围。
也就是说,我们可以猜测.(点、句号、句号)在计算机科学中的含义:
注意: 使用GET 参数avoid it if you can and read more 发送凭据被认为是一种不好的做法。
【讨论】:
curl --help 获取帮助文档