CURL发送HTTP请求
来源:互联网 发布:org.apache.poi maven 编辑:程序博客网 时间:2024/05/17 09:32
<span style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: rgb(255, 255, 255);">1.</span><span style="font-size: 12px; background-color: rgb(255, 255, 255); font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;"><span style="line-height: 18.99305534362793px;">发送POST请求</span></span>
curl --data "value=lihzhiming%20&data=jiajia&ia=234" "localhost:8080"
默认发送的是GET请求,如何加上--data也就是需要附加参数,那么也是POST请求,以上就是加上参数value,data,ia
2.发送GET请求
curl "localhost:8080?value=lihzhiming%20&data=jiajia&ia=234"
参数直接接在URI后面那么就是GET请求
3.发送本地文件
<form method="POST" enctype="multipar/form-data" action="http://cgi2.tky.3web.ne.jp/~zzh/up_file.cgi"><input type=file name=upload><input type=submit name=nick value="go"></form>curl -F upload=@localfile -F nick=go http://cgi2.tky.3web.ne.jp/~zzh/up_file.cgi
4.下载一个页面
curl -x 123.45.67.89:1080 -o page.html http://www.yahoo.com
5.以特定浏览器去访问
curl -A "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" -x 123.45.67.89:1080 -o page.html -D cookie0001.txt http://www.yahoo.com
这样,服务器端接到访问的要求,会认为你是一个运行在Windows 2000上的IE6.0,嘿嘿嘿,其实也许你用的是苹果机呢!
6.另外一个服务器端常用的限制方法,就是检查http访问的referer。比如你先访问首页,再访问里面所指定的下载页,这第二次访问的referer地址就是第一次访问成功后的页面地址。这样,服务器端只要发现对下载页面某次访问的referer地址不 是首页的地址,就可以断定那是个盗连了~~~~~
curl给我们提供了设定referer的option: -e
curl -A "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" -x 123.45.67.89:1080 -e "mail.yahoo.com" -o page.html -D cookie0001.txt http://www.yahoo.com
这样,就可以骗对方的服务器,你是从mail.yahoo.com点击某个链接过来的了
7.保存响应头
curl -D file "localhost:8080"
- CURL发送HTTP请求
- curl 发送http 请求
- curl 模拟http发送请求
- bat curl 发送http请求 监控网站
- curl 发送HTTP请求 常用用法
- PHP使用CURL发送HTTP请求代码
- 使用curl命令发送http请求
- 利用curl来发送http请求
- 使用CURL来发送HTTP请求的方法
- php file_get_contens()和Curl发送http请求的区别
- curl模拟http发送get或post请求
- PHP CURL 发送请求
- curl命令发送请求
- curl发送请求总结
- curl外另外一种发送http请求和接收http请求的方式
- curl模拟http请求
- HTTP协议 fsockopen模拟请求代理端发送get post请求 curl基本使用
- curl命令发送Post请求
- Android工程目录结构详解
- 百度之星初赛第二场1005
- (传输层)TCP协议
- Java实现百度贴吧自动签到器
- 大数据处理之一
- CURL发送HTTP请求
- Rspec 测试
- UDP协议及包格式
- 关于加速程式执行效率的几条方法
- POJ 题目3928 Ping pong(树状数组)
- 传智播客:复制文本文件
- Google Code Jam Round2 A,B题解
- POJ 3903 【最长递增子序列 NLOGN】
- 入手树莓派