curl: add Chinese translaion (partial)

italian
KsRyY 2019-08-16 10:15:45 +08:00 committed by Starbeamrainbowlabs
parent 63039eb5e2
commit 45d086c459
1 changed files with 37 additions and 0 deletions

37
pages.zh/common/curl.md Normal file
View File

@ -0,0 +1,37 @@
# curl
> 向/从一个服务器传输数据.
> 支持大多数协议, 包括 HTTP, FTP, 和 POP3.
> 更多信息: <https://curl.haxx.se>.
- 将指定URL的内容下载到文件:
`curl {{http://example.com}} -o {{文件名}}`
- 将文件从URL保存到由URL指示的文件名中:
`curl -O {{http://example.com/文件名}}`
- 下载文件, 跟随 [L]重定向, 并且自动 [C]续传(恢复)前序文件传输:
`curl -O -L -C - {{http://example.com/文件名}}`
- Send form-encoded data (POST request of type `application/x-www-form-urlencoded`):
`curl -d {{'name=bob'}} {{http://example.com/form}}`
- Send a request with an extra header, using a custom HTTP method:
`curl -H {{'X-My-Header: 123'}} -X {{PUT}} {{http://example.com}}`
- Send data in JSON format, specifying the appropriate content-type header:
`curl -d {{'{"name":"bob"}'}} -H {{'Content-Type: application/json'}} {{http://example.com/users/1234}}`
- Pass a user name and password for server authentication:
`curl -u myusername:mypassword {{http://example.com}}`
- Pass client certificate and key for a resource, skipping certificate validation:
`curl --cert {{client.pem}} --key {{key.pem}} --insecure {{https://example.com}}`