linux curl请求中的单引号、双引号及变量
4.1、单引号、双引号结合使用
参数是在单引号中,比如 'Content-type:application/json'
json中的 k-v 是要在双引号中,所以如果遇到要在curl中使用变量,就使用 字符串拼接
1 | curl -i -X POST -H 'Content-type:application/json' \ |
4.2、全部使用双引号
不方便的地方在于json中的k-v都需要使用双引号,那就需要进行转移",如果json中的k-v很多,那就书写有点麻烦
1 | curl -X POST -H "Content-Type:application/json" \ |
输出了状态码、用户IP和响应时长
具体的标识有:
content_type
filename_effective
ftp_entry_path
http_code
http_connect
local_ip
local_port
num_connects
num_redirects
redirect_url
remote_ip
remote_port
size_download
size_header
size_request
size_upload
speed_download
speed_upload
ssl_verify_result
time_appconnect
time_connect
time_namelookup
time_pretransfer
time_redirect
time_starttransfer
time_total
url_effective
linux curl请求中的单引号、双引号及变量