承接 rmiller/hal-guzzle-response 相关项目开发

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

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

rmiller/hal-guzzle-response

最新稳定版本:0.4.0

Composer 安装命令:

composer require rmiller/hal-guzzle-response

包简介

Adds Hal resources to Guzzle Responses

关键字:

README 文档

README

Scrutinizer Code Quality Build Status

Guzzle event subscriber to decorate responses to provide Hal resources.

If you register the listener it will decorate the responses from Guzzle giving them a hal method. This will return a Nocarrier\Hal resource created from the response body.

Installation

Require the extension:

$ composer require rmiller/hal-guzzle-response:~0.1

Usage

Attach the listener:

$client = new \GuzzleHttp\Client();
$emitter = $client->getEmitter();
$subscriber = new \RMiller\HalGuzzleResponse\GuzzleSubscriber();
$emitter->attach($subscriber);

Get the Hal resource from the response:

$response = $client->get($url);
$hal = $response->hal(); //\Nocarrier\Hal

Note: an attempt will be made to convert the response body from JSON and XML to a Hal resource. If neither is successful a \RuntimeException will be thrown. This happens when hal is called, so it is safe to wrap other responses and not call hal.

统计信息

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

GitHub 信息

  • Stars: 4
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-11-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固