当前位置:网站首页>Detailed explanation and examples of common parameters of curl
Detailed explanation and examples of common parameters of curl
2022-06-21 12:59:00 【51CTO】
curl brief introduction
curl Is an open source command line tool , It is based on network protocol , Specify URL Network transmission , After getting the data, there is no specific processing ( Such as :html And so on ), Display directly in " standard output "(stdout) On .
curl There are many supported network protocols , Include :DICT、FILE、FTP、FTPS、GOPHER、GOPHERS、HTTP、HTTPS、IMAP、IMAPS、LDAP、LDAPS、MQTT、POP3、POP3S、RTMP、RTMPS、RTSP、SCP、SFTP、SMB、SMBS、SMTP、SMTPS、TELNET and TFTP.
curl There are also many parameters , Here are some common parameters , It is recommended to save .
send out GET request
When curl Without any parameters ,curl Default issue GET request , The content returned by the server will not be parsed and will be displayed directly on the command line . Example :
Because you need to jump to HTTPS, So back 301:
send out POST request
Use -d When parameters are ,header Of Content-Type Is automatically assigned to application/x-www-form-urlencoded, And send POST request . Example :
Because you need to jump to HTTPS, Also return to 301:
send out json request
send out json The request also requires two parameters :-X Parameter assignment HTTP Requested method ,-H Parameter assignment HTTP Requested header. Example :
among ,-X Parameter assignment HTTP The request method is POST,-H Nibble at specified header Of Content-Type by application/json; charset=UTF-8 ,-d The parameter specifies that the data is {“user”:“ Wan Maoxue ”,“pwd”:“onemore”} .
Show HTTP Response head
-i The parameter displays the response content of the server at the same time , It also shows HTTP Response head . Example :
The response header of the server will be displayed first , Then leave a blank line , Then display the server response content , as follows :
Show the response process
-v The whole response process of parameter display , We can see what happened at the bottom . Example :
It is shown as follows :
among , With * The first line indicates curl Additional information provided , With > The first line represents the request header , < The first line represents the response header .
Only response headers are displayed
Sometimes the response content is too long , When you only care about the response header , have access to -I Parameters . Example :
It is shown as follows :
Reference link :
https://curl.se/docs/manpage.html
https://www.ruanyifeng.com/blog/2019/09/curl-reference.html
边栏推荐
- 居家辦公初體驗之新得分享| 社區征文
- uva11729
- Qinglong panel, JD timed task library, script library
- Huawei cloud releases desktop ide codearts
- Postgre SQL 支持的数据类型分类
- AGCO AI frontier promotion (6.21)
- Graveyard
- CVPR2022 | 上科大x小红书首次提出动作序列验证任务,可应用于体育赛事打分等多场景
- An error "\.\global\vmx86" is reported when vmware12 virtual machine is opened: the system cannot find the specified file.
- Annual special analysis of China Mobile Banking in 2022
猜你喜欢

Kubernets Rapid Practical fighting and Core Principle Analysis

Pre training weekly (50): no decoding converter, neural prompt search, gradient space dimensionality reduction

Educoder table label - basic table structure

Distributed transactions, simple in principle, are all pits in writing

不止于ZeRO:BMTrain技术原理浅析

塔米狗项目解读:济宁华源项目管理有限公司34%股权转让

Generalized Focal Loss: Learning Qualified and Distributed Bounding Boxes for Dense Object Detection

【升级版学生信息管理系统】+文件操作+更多细节

Router telnet and ACL configuration
![[upgraded student information management system] + file operation + more details](/img/a3/de30e67e1ad73262a9e2cf38e6520c.png)
[upgraded student information management system] + file operation + more details
随机推荐
显示Oracle某一张表的所有索引
Flink CDC MongoDB Connector 的实现原理和使用实践
云桌面是什么意思?与堡垒机有什么区别?
Nouveau partage de l'expérience de travail à domicile
UVA1203 Argus
分布式事务,原理简单,写起来全是坑
Educoder Web练习题---交互元素
Educoder web exercise - validating forms
用时间戳优化 TCP 实践
uva11991
uva11995
ICLR2022 | 训练面向分子模拟的十亿级参数 GNN
postgreSQL中的MVCC
Educoder Web练习题---创建输入控件
《預訓練周刊》第50期:無解碼變換器、神經提示搜索、梯度空間降維
Summary of several ways to calculate distance
TOOD: Task-aligned One-stage Object Detection
Distributed transaction processing scheme big PK
Eureka的TimedSupervisorTask类(自动调节间隔的周期性任务)
Pingcap was selected as the "voice of customers" of Gartner cloud database in 2022, and won the highest score of "outstanding performer"