加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

curl常用命令备忘

发布时间:2020-12-14 01:31:58 所属栏目:Linux 来源:网络整理
导读:#####(输出请求头信息) curl -I xxx-Pro:test xxx$ curl -I https://www.baidu.com/ HTTP/1.1 200 OK Accept-Ranges: bytes Cache-Control: private,no-cache,no-store,proxy- revalidate,no-transform Connection: Keep-Alive Content-Length: 277 Conten
#####(输出请求头信息) curl -I 
xxx-Pro:test xxx$ curl -I https://www.baidu.com/   
HTTP/1.1 200 OK    
Accept-Ranges: bytes     
Cache-Control: private,no-cache,no-store,proxy-    revalidate,no-transform    
Connection: Keep-Alive    
Content-Length: 277    
Content-Type: text/html    
Date: Wed,24 Apr 2019 09:37:25 GMT    
Etag: "575e1f6d-115"    
Last-Modified: Mon,13 Jun 2016 02:50:21 GMT    
Pragma: no-cache    
Server: bfe/1.0.8.18     

#####(需要post的data数据) curl -d     
curl -d ‘name=xxx&passwd=yyy‘ www.baidu.com     

#####(要输出的文件地址 输出cookie信息) curl -c      
curl -c cookie -d ‘email=xxx&password=yyy‘ http://api.xxx.cn:8115/api/user/login              
{"errcode":0,"errmsg":"logout success...","data":    {"username":"xxx","role":"member","uid":    1100,"email":"xxx","add_time":1542010178      

#####(携带cookie进行请求)  curl -b cookie www.baidu.com               

#####(自定义header ) curl -H ‘User-Agent: Custom-User-Agent‘     

#####(把输出写到该文件)  curl -o    

curl -o ./baidu.html  http://www.baidu.com     
ls
baidu.html

    
#####(把输出写到该文件中,保留远程文件的文件名) curl -O https://www.baidu.com/img/[email?protected]      

 
#####(上传文件)  curl -T xxx.txt -u 用户名:密码 ftp://www.xxxx.com/txt/  

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读