Skip to content

Commit 1425249

Browse files
authored
Update curl.md
1 parent 292b7e3 commit 1425249

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

command/curl.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,5 +236,25 @@ Vary: Accept-Encoding
236236
X-Pingback: http://man.linuxde.net/xmlrpc.php
237237
```
238238

239+
**get请求 **
239240

240-
<!-- Linux命令行搜索引擎:https://jaywcjlove.github.io/linux-command/ -->
241+
```bash
242+
curl "http://www.baidu.com" # 如果这里的URL指向的是一个文件或者一幅图都可以直接下载到本地
243+
curl -i "http://www.baidu.com" # 显示全部信息
244+
curl -l "http://www.baidu.com" # 只显示头部信息
245+
curl -v "http://www.baidu.com" # 显示get请求全过程解析
246+
```
247+
248+
**post请求**
249+
250+
```bash
251+
curl -d "param1=value1&param2=value2" "http://www.wangchujiang.com"
252+
```
253+
254+
**json格式的post请求**
255+
256+
```bash
257+
curl -l -H "Content-type: application/json" -X POST -d '{"phone":"13521389587","password":"test"}' http://wangchujiang.com/apis/users.json
258+
```
259+
260+
<!-- Linux命令行搜索引擎:https://jaywcjlove.github.io/linux-command/ -->

0 commit comments

Comments
 (0)