Linux   发布时间:2022-04-01  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了curl常用命令备忘大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

#####(输出请求头信息) 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-trans
#####(输出请求头信息) 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/  

大佬总结

以上是大佬教程为你收集整理的curl常用命令备忘全部内容,希望文章能够帮你解决curl常用命令备忘所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: