易陆发现互联网技术论坛

 找回密码
 开始注册
查看: 94|回复: 1
收起左侧

curl get和post请求 curl -s

[复制链接]
发表于 2023-11-30 11:00:01 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?开始注册

x
GET 请求3 G; V- n  e, W, r
curl "http://www.example.com"    # 如果这里的URL指向的是一个文件或者一幅图都可以直接下载到本地$ C! \9 P; ^1 a* d. v
curl -i "http://www.example.com" # 显示全部信息8 y% P: G' |& i- L
curl -l "http://www.example.com" # 显示页面内容
# M9 @* W4 }1 e& A/ }curl -v "http://www.example.com" # 显示get请求全过程解析
7 {. c6 v7 `2 u; H  r1 }9 ~. K7 \( B, T5 ~
POST 请求2 P: ]& c' E$ o# v
$ curl -d "param1=value1&param2=value2" "http://www.test.com/login"
: T% k, @" T" U+ [- t8 Y) b5 i
0 J* k. H  B- J! s( ~  k$ curl -d'login=emma&password=123' -X POST https://test.com/login
# H) t7 M' P! f4 A$ h; ?$ ~# 或者+ J- {) Z* Y$ I% F. M+ p
$ curl -d 'login=emma' -d 'password=123' -X POST  https://test.com/login. ?: R( }, Y4 C$ K4 N4 Z$ @

" R# O# i9 d# D: Z9 N' U+ x: G& H- Y4 h6 p) t% ?# v
 楼主| 发表于 2023-11-30 11:00:02 | 显示全部楼层
curl -s  https://www.baidu.com
9 L! }& d# {4 C+ p<!DOCTYPE html>2 r- U" }+ k+ ^+ x2 f9 D
<!--STATUS OK--><html> <head><meta http-equiv=content-type content=text/html;charset=utf-8><meta http-equiv=X-UA-Compatible content=IE=Edge><meta content=always name=referrer><link rel=stylesheet type=text/css href=https://ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/r/www/cache/bdorz/baidu.min.css><title>百度一下,你就知道</title></head> <body link=#0000cc> <div id=wrapper> <div id=head> <div class=head_wrapper> <div class=s_form> <div class=s_form_wrapper> <div id=lg> <img hidefocus=true src=//www.baidu.com/img/bd_logo1.png width=270 height=129> </div> <form id=form name=f action=//www.baidu.com/s class=fm> <input type=hidden name=bdorz_come value=1> <input type=hidden name=ie value=utf-8> <input type=hidden name=f value=8> <input type=hidden name=rsv_bp value=1> <input type=hidden name=rsv_idx value=1> <input type=hidden name=tn value=baidu><span class="bg s_ipt_wr"><input id=kw name=wd class=s_ipt value maxlength=255 autocomplete=off autofocus=autofocus></span><span class="bg s_btn_wr"><input type=submit id=su value=百度一下 class="bg s_btn" autofocus></span> </form> </div> </div> <div id=u1> <a href=http://news.baidu.com name=tj_trnews class=mnav>新闻</a> <a href=https://www.hao123.com name=tj_trhao123 class=mnav>hao123</a> <a href=http://map.baidu.com name=tj_trmap class=mnav>地图</a> <a href=http://v.baidu.com name=tj_trvideo class=mnav>视频</a> <a href=http://tieba.baidu.com name=tj_trtieba class=mnav>贴吧</a> <noscript> <a href=http://www.baidu.com/bdorz/login.gif?login&amp;tpl=mn&amp;u=http%3A%2F%2Fwww.baidu.com%2f%3fbdorz_come%3d1 name=tj_login class=lb>登录</a> </noscript> <script>document.write('<a href="http://www.baidu.com/bdorz/login.gif?login&tpl=mn&u='+ encodeURIComponent(window.location.href+ (window.location.search === "" ? "?" : "&")+ "bdorz_come=1")+ '" name="tj_login" class="lb">登录</a>');
! P/ c. ^+ o  _) y+ o. I, ]  j( j- H                </script> <a href=//www.baidu.com/more/ name=tj_briicon class=bri style="display: block;">更多产品</a> </div> </div> </div> <div id=ftCon> <div id=ftConw> <p id=lh> <a href=http://home.baidu.com>关于百度</a> <a href=http://ir.baidu.com>About Baidu</a> </p> <p id=cp>&copy;2017&nbsp;Baidu&nbsp;<a href=http://www.baidu.com/duty/>使用百度前必读</a>&nbsp; <a href=http://jianyi.baidu.com/ class=cp-feedback>意见反馈</a>&nbsp;京ICP证030173号&nbsp; <img src=//www.baidu.com/img/gs.gif> </p> </div> </div> </div> </body> </html>
9 f  n2 C+ q! A9 F" u
您需要登录后才可以回帖 登录 | 开始注册

本版积分规则

关闭

站长推荐上一条 /4 下一条

北京云银创陇科技有限公司以云计算运维,代码开发

QQ|返回首页|Archiver|小黑屋|易陆发现技术论坛 点击这里给我发消息

GMT+8, 2026-4-8 15:28 , Processed in 0.056180 second(s), 21 queries .

Powered by Discuz! X3.4 Licensed

© 2012-2025 Discuz! Team.

快速回复 返回顶部 返回列表