Skip to content

Commit

Permalink
fixed: update curl example
Browse files Browse the repository at this point in the history
  • Loading branch information
zhanghuid committed Aug 6, 2024
1 parent d1e49d8 commit f6149f1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions docs/practice/curl.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ CURL 备忘
<!--rehype:body-class=cols-1-->
### curl
```bash preview
curl -o /dev/null -s \
-w %{time_namelookup}::%{time_connect}::%{time_starttransfer}::%{time_total}::%{speed_download}"\n" \
--data-binary @req.dat https://www.baidu.com
curl -o /dev/null -s -w \
"time_namelookup:%{time_namelookup}\ntime_connect: %{time_connect}\ntime_starttransfer: %{time_starttransfer}\ntime_total: %{time_total}\n" https://www.baidu.com

# 参数说明
-o /dev/null: 将请求的输出重定向到 /dev/null,即丢弃输出。
Expand All @@ -21,7 +20,6 @@ curl -o /dev/null -s \
%{time_total}: 表示总的传输时间(秒)。
%{speed_download}: 表示平均下载速度(每秒字节数)。
"\\n": 在格式化输出的末尾添加换行符。
--data-binary @req.dat: 发送文件 req.dat 的二进制内容作为请求体。
https://www.baidu.com: 发送请求的目标 URL。

```
Expand Down

0 comments on commit f6149f1

Please sign in to comment.