模拟请求之 HTTP_Request2
简单安装:
pear install HTTP_Request2
使用例子:
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2('http://localhost/', HTTP_Request2::METHOD_GET);
try {
$response = $request->send();
if (200 == $response->getStatus()) {
echo $response->getBody();
} else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
} catch (HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
?>
详情:http://pear.php.net/manual/en/package.http.http-request2.intro.php
模拟请求之 HTTP_Request2的更多相关文章
- http国际化模拟请求
现在好多系统都有国际化的需求.不同国家的人读到不同的语言数据.那么怎么模拟请求的时候区分是哪个国家的语言信息,代码说明. HttpPost methed = new HttpPost("模拟 ...
- http模拟请求工具
http模拟请求工具: postman(chrome应用) Request Maker(chrome插件) Request Maker(网站:http://www.requestmaker.com/) ...
- c# JD快速搜索工具,2015分析JD搜索报文,模拟请求搜索数据,快速定位宝贝排行位置。
分析JD搜索报文 搜索关键字 女装 第二页,分2次加载. rt=1&stop=1&click=&psort=&page=3http://search.jd.com/Se ...
- telnet简单操作 模拟请求
telnet简单操作 模拟请求 一: 二: 三: 按照以上操作即可!
- 从session实现机制分析模拟请求验证码的可行性(转)
悲剧了,发现写完这篇blog没有配上这个格调超高的标题. 1.0问题背景 现在要实现一个带验证码网站的的自动登陆功能.验证码识别过程不再这篇文章的讨论之中.(之后有篇文章我会详细的总结验证码的识别 ...
- Fiddler 模拟请求的操作方法
此文记录使用Fidder Web Debugger工具,模拟请求的操作步骤! 首先简述一下fiddler的使用: 1.下载安装Fidder抓包工具. 2.打开fiddler发现有左边的栏有请求的url ...
- iOS项目之模拟请求数据
如何在iOS开发中更好的做假数据? 当工期比较紧的时候,项目开发中会经常出现移动端等待后端接口数据的情形,不但耽误项目进度,更让人有种无奈的绝望.所以在开发中,我们常常自己做些假数据,以方便开发和UI ...
- 转载:curl 模拟请求
一般情况下我们会在网页上请求后台接口,但是对于需要进行多次测试的人来说,每一次都要在网页上模拟请求,是存在很大局限性的.因此,我们需要学会模拟请求,以达到跟实际请求一样的效果. 1. curl的用法 ...
- curl 模拟请求
https://www.jianshu.com/p/7965c56c5a2e ********************************************* 一般情况下我们会在网页上请求后 ...
随机推荐
- [AngularJS] Best Practise - Resolve promises in router, defer controllers
See more:http://toddmotto.com/opinionated-angular-js-styleguide-for-teams/ /** * Created by Answer12 ...
- sphinx配置文件继承
# # Minimal Sphinx configuration sample (clean, simple, functional) # source mysql { type = mysql #数 ...
- Codeforces 444C DZY Loves Colors(线段树)
题目大意:Codeforces 444C DZY Loves Colors 题目大意:两种操作,1是改动区间上l到r上面德值为x,2是询问l到r区间总的改动值. 解题思路:线段树模板题. #inclu ...
- C 二叉树
二叉树表示法 P127页 /* typedef struct BiTNode { int data; struct BiTNode *lchild, *rchild; }BiTNode, *BiTre ...
- PAT 1006
1006. Sign In and Sign Out (25) At the beginning of every day, the first person who signs in the com ...
- C#_约束 实现可排序单链表
using System; using System.Collections.Generic; using System.Linq; using System.Text; /* 使用 约束 实现可排序 ...
- android平台获取手机IMSI,IMEI ,序列号,和 手机号的方法
1)获取运营商sim卡imsi号, String IMSI =android.os.SystemProperties.get( android.telephony.TelephonyPropertie ...
- C# 重新改变数组的长度
重新改变数组的长度 System.Array.Resize(ref FieldName, j);
- OC中-数组是如何遍历的?
#import <Foundation/Foundation.h> int main (int argc, const char * argv[]) { NSAutoreleasePool ...
- Oracle inactive session (last_call_et)
注意last_call_et的值, select s.status,s.last_call_et,s.* from v$session s where username='DDD'; 在本例中,开了个 ...