承接 fishtail/http 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

fishtail/http

最新稳定版本:v1.0.1

Composer 安装命令:

composer require fishtail/http

包简介

Http GET and POST methods.

README 文档

README

经常在项目里面会用上GET和POST请求方法,使用封装好的方法会方便很多。

一、安装

composer require fishtail/http

二、使用

1. 导入

use Fishtail\Http;

2. GET请求

$res = Http::get('https://www.baidu.com');

3. POST请求

$url = 'http://example.com';
$header = [
	'Accept: */*',
	'Content-Type: text/plain;charset=UTF-8'
];
$cookie = 'token=2f2568ae-75f0-4ba9-98d4-8c139dad7f64';
$postData = [
	'page' => 1,
	'pageSize' => 20
];
$res = Http::post($url, $postData, $cookie, $header);

三、参数解释

1. GET方法

参数 类型 描述
url string 请求的url
cookie string 请求cookie
header array 请求头数据
returnCookie bool 是否返回cookie

1. POST方法

参数 类型 描述
url string 请求的url
data string|array post数据
cookie string 请求cookie
header array 请求头数据
returnCookie bool 是否返回cookie

统计信息

  • 总下载量: 374
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-07-26