没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
![application/x-rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![application/x-rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![txt](https://img-home.csdnimg.cn/images/20210720083642.png)
![txt](https://img-home.csdnimg.cn/images/20210720083642.png)
![txt](https://img-home.csdnimg.cn/images/20210720083642.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![txt](https://img-home.csdnimg.cn/images/20210720083642.png)
![text/x-c](https://img-home.csdnimg.cn/images/20210720083646.png)
![txt](https://img-home.csdnimg.cn/images/20210720083642.png)
![text/x-c](https://img-home.csdnimg.cn/images/20210720083646.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![text/plain](https://img-home.csdnimg.cn/images/20210720083646.png)
![text/x-c++](https://img-home.csdnimg.cn/images/20210720083646.png)
![txt](https://img-home.csdnimg.cn/images/20210720083642.png)
![txt](https://img-home.csdnimg.cn/images/20210720083642.png)
![txt](https://img-home.csdnimg.cn/images/20210720083642.png)
![txt](https://img-home.csdnimg.cn/images/20210720083642.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
本文由rininia贡献
001 <?php
002 /************************************************************
003 * 描述:HTTP操作类
004 * 作者:heiyeluren
005 * 创建:2009/12/13 04:43
006 * 修改:2009/12/16 10:30 实现基本HTTP各种接口操作支持
007 *
008 ************************************************************/
009
010
011 /**
012 * HTTP功能工厂方法类
013 *
014 * 调用示例代码:
015 try {
016 $http = Http::factory('http://www.baidu.com', Http::TYPE_SOCK );
017 echo $http->get();
018 $http = Http::factory('http://127.0.0.1/test/i.php', Http::TYPE_SOCK );
019 echo $http-><SPAN class=t_tag onclick=tagshow(event) href="tag.php?name=post">post</SPAN>('', array('user'=>'我们', 'nick'=>'ASSADF@#!32812989+-239%ASDF'), '', array('aa'=>'bb', 'cc'=>'dd'));
020 } catch (Exception $e) {
021 echo $e->getMessage();
022 }
023 */
024 class Http
025 {
026 /**
027 * @var 使用 CURL
028 */
029 const TYPE_CURL = 1;
001 <?php
002 /************************************************************
003 * 描述:HTTP操作类
004 * 作者:heiyeluren
005 * 创建:2009/12/13 04:43
006 * 修改:2009/12/16 10:30 实现基本HTTP各种接口操作支持
007 *
008 ************************************************************/
009
010
011 /**
012 * HTTP功能工厂方法类
013 *
014 * 调用示例代码:
015 try {
016 $http = Http::factory('http://www.baidu.com', Http::TYPE_SOCK );
017 echo $http->get();
018 $http = Http::factory('http://127.0.0.1/test/i.php', Http::TYPE_SOCK );
019 echo $http-><SPAN class=t_tag onclick=tagshow(event) href="tag.php?name=post">post</SPAN>('', array('user'=>'我们', 'nick'=>'ASSADF@#!32812989+-239%ASDF'), '', array('aa'=>'bb', 'cc'=>'dd'));
020 } catch (Exception $e) {
021 echo $e->getMessage();
022 }
023 */
024 class Http
025 {
026 /**
027 * @var 使用 CURL
028 */
029 const TYPE_CURL = 1;
030 /**
031 * @var 使用 Socket
032 */
033 const TYPE_SOCK = 2;
034 /**
035 * @var 使用 Stream
036 */
037 const TYPE_STREAM = 3;
038
039
040 /**
041 * 保证对象不被clone
042 */
043 private function __clone() {}
044
045 /**
046 * 构造<SPAN class=t_tag onclick=tagshow(event) href="tag.php?name=%BA%AF%CA%FD">函数</SPAN>
047 */
048 private function __construct() {}
049
050
051 /**
052 * HTTP工厂操作方法
053 *
054 * @param string $url 需要访问的URL
055 * @param int $type 需要使用的HTTP类
056 * @return object
057 */
058 public static function factory($url = '', $type = self::TYPE_SOCK){
059 if ($type == ''){
031 * @var 使用 Socket
032 */
033 const TYPE_SOCK = 2;
034 /**
035 * @var 使用 Stream
036 */
037 const TYPE_STREAM = 3;
038
039
040 /**
041 * 保证对象不被clone
042 */
043 private function __clone() {}
044
045 /**
046 * 构造<SPAN class=t_tag onclick=tagshow(event) href="tag.php?name=%BA%AF%CA%FD">函数</SPAN>
047 */
048 private function __construct() {}
049
050
051 /**
052 * HTTP工厂操作方法
053 *
054 * @param string $url 需要访问的URL
055 * @param int $type 需要使用的HTTP类
056 * @return object
057 */
058 public static function factory($url = '', $type = self::TYPE_SOCK){
059 if ($type == ''){
剩余29页未读,继续阅读
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/e0d5ae5f1feb4f0b860e3e58c7f2bbe6_a1_a1a.jpg!1)
a1_a1a
- 粉丝: 0
- 资源: 114
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
最新资源
- matlab+数据预处理+ARIMA预测+异常值+检测+适用于各种类型的数据集
- Python旅游数据爬虫及可视化展示源码
- 基于MFC恶意PE,Android签名流检测系统框架 vs2022 + c/c++ + mfc + PE + APK
- 基于MFC恶意文件检测系统 框架 vs2022 + c/c++ + hook + PE + inject + 动态调试工具Imm
- 基于MFC恶意文件检测系统框架 vs2022 + c/c++ + hook + PE + inject + 动态调试工具Imm
- 八路抢答器电子工艺实习报告
- 5积分 MongoDB V3.6.32 Plus(SSL) For Windows
- 大学生方程式赛车设计(总体设计)
- 【哈工大计算机系统】CSAPP计统大作业
- 音视频对齐python脚本
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback-tip](https://img-home.csdnimg.cn/images/20220527035111.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)