someline/rest-api-client 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

someline/rest-api-client

Composer 安装命令:

composer require someline/rest-api-client

包简介

An elegant and smart Rest API Client with OAuth2 authentication support. Build for Laravel and Someline Starter.

README 文档

README

Latest Version Software License Total Downloads

Someline Starter API Client is an elegant and smart Rest API Client with OAuth2 authentication support.

Build for Laravel and Someline Starter.

It can be used for accessing APIs created using Someline Starter framework.

Install

Via Composer

Install composer package to your laravel project

composer require someline/rest-api-client

Add Service Provider to config/app.php

    'providers' => [
        ...
        Someline\Rest\RestClientServiceProvider::class,
        ...
    ],

Publishing config file.

php artisan vendor:publish

After published, config file for Rest Client is config/rest-client.php, you will need to config it to use Rest Client.

Usage

$restClient = new \Someline\Rest\RestClient('someline-starter');

$restClient->setOAuthUserCredentials([
    'username' => 'libern@someline.com',
    'password' => 'Abc12345',
]);
$restClient->withOAuthTokenTypeUser();

$response = $restClient->get("users")->getResponse();
if (!$restClient->isResponseStatusCode(200)) {
    $restClient->printResponseOriginContent();
    $responseMessage = $restClient->getResponseMessage();
    print_r($responseMessage);
} else {
    $responseData = $restClient->getResponseData();
    print_r($responseData);
}

Testing

phpunit

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 13.41k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 9
  • 点击次数: 15
  • 依赖项目数: 3
  • 推荐数: 0

GitHub 信息

  • Stars: 8
  • Watchers: 2
  • Forks: 7
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-07-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固