php 模拟get/post封装类

时间:2018-02-04 04:57:01
【文件属性】:

文件名称:php 模拟get/post封装类

文件大小:3KB

文件格式:ZIP

更新时间:2018-02-04 04:57:01

php get post

'我是UA', 'referer' => '我是来源地址', 'ip' => '我是IP', 'cookie' => 'cookie.txt', ); //第一种GET /* $http = new HttpRequest(); $res = $http->set($config) ->open('http://127.0.0.1/HttpRequest/r.php') ->get(); */ //第二种GET /* $http = new HttpRequest($config); $res = $http->open('http://127.0.0.1/HttpRequest/r.php') ->get(); */ //POST 同上 $http = new HttpRequest(); $res = $http->set($config) ->open('http://127.0.0.1/HttpRequest/r.php') ->post(array('time' => time())); echo '请求状态码:'. $res->HttpCode(); echo '
头部信息:
'. $res->header(); echo '
网页内容:
'. $res->body(); ?>


【文件预览】:
HttpRequest.php
r.php
Demo.php
cookie.txt

网友评论