我正在看一个curl
命令示例,该命令在文件名之前使用@符号将数据发布到服务器。
curl http://localhost/ --data-binary @file.txt
这是什么意思?是否将文件内容插入命令?是特定于curl
?
我正在看一个curl
命令示例,该命令在文件名之前使用@符号将数据发布到服务器。
curl http://localhost/ --data-binary @file.txt
这是什么意思?是否将文件内容插入命令?是特定于curl
?
Answers:
它特定于卷曲。来自man curl
:
--data-binary <data>
(HTTP) This posts data exactly as specified with no extra processing whatsoever.
If you start the data with the letter @, the rest should be a filename. Data is
posted in a similar manner as --data-ascii does, except that newlines are preserved
and conversions are never done.
If this option is used several times, the ones following the first will append data
as described in -d, --data.