承接 jamm/http 相关项目开发

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

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

jamm/http

最新稳定版本:1.0.0

Composer 安装命令:

composer require jamm/http

包简介

Objects to easy manipulate by HTTP-requests and responses

README 文档

README

Objects to easy manipulate by HTTP-requests and responses

Example of sending request:

$Response = new Response();
$Request  = new Request();
$Request->setMethod(Request::method_POST);
$Request->setHeader('Authorization', 'auth_token');
$Request->setDataKey('some_post_key', 'some value');
$Request->Send('https://api.example.com', $Response);

print $Response->getBody();

##Features Headers in Request and Response are case-insensitive:

$Request->setHeader('Authorization', 'token');  
$Request->setHeader('authorization', 'auth_token');  

// second line will not create new header and will update existing one    
// $Request->getHeaders('AUTHORIZATION') will return:    
// auth_token  

Body of response can be automatically unpacked from JSON or XML

// next line will create header Accept: JSON in request,
// and body of response will be automatically decoded from JSON

$Response->setSerializer(new SerializerJSON());

SSL support
Easy to test and extend

##License MIT

统计信息

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

GitHub 信息

  • Stars: 20
  • Watchers: 4
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2012-12-04