cURL-d。参数
我有一个curl命令:cURL-d。参数,curl,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.代表什么?它能做什么?当你有疑问时,使用man 发布man curl并阅读-d开关 -d, --data <data>
curl -k -d . -o SessionRequest.txt
"https://myserver.com/MyWebApi/user?companysn=1234&login=my_login&password=my_password&ApiKey=my_api_key"
-d.
代表什么?它能做什么?当你有疑问时,使用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
[...]
将JSON字符串发送到服务器
在您的示例中,它只是将
字符作为ASCII数据发送到服务器。它的作用取决于服务器逻辑,并且不在curl
命令范围内
这就是说,我们可以猜出
(点、句号、句号)在计算机科学中可能意味着什么:
- 点是Unix文件系统中当前目录的占位符李>
- 点是大多数正则表达式语法中任何字符的通配符李>
- 点是域名中标签之间的分隔符李>
- 点是文件名和扩展名的常用分隔符李>
注:使用
GET
参数发送凭据被认为是一种不好的做法。我确实阅读了手册页,但什么都看不懂。我仍然无法理解“.”的作用。这个“.”没有任何魔力。它是一个文本“.”,将作为数据发送。@EricObermühlner,这确实超出了curl命令的范围。这将委托给后面的服务器逻辑。Curl只是中间人。
curl -d '{"hello": "world"}' -X POST -H "Content-Type: application/json" https://example.com