kfosoft/php-restful-client 问题修复 & 功能扩展

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

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

kfosoft/php-restful-client

最新稳定版本:1.0

Composer 安装命令:

composer require kfosoft/php-restful-client

包简介

PHP RESTful Client

README 文档

README

Installation

Installation with Composer

Either run

    php composer.phar require --prefer-dist kfosoft/rest-client:"*"

or add in composer.json

    "require": {
            ...
            "kfosoft/php-restful-client":"*"
    }

Well done!

Example call GET

    $result = (new RestClient())->requestParams(RestClient::GET, $url, $data)->call();

Example call CUSTOM with GET data

    $result = (new RestClient())->requestParams(RestClient::CUSTOM, $url, $data)->call();

Example call CUSTOM with POST data

    $result = (new RestClient())->requestParams(RestClient::CUSTOM, $url, $data)->usePost()->call();

Example call to url with http auth

    $result = (new RestClient())->requestParams(RestClient::POST, $url, $data)->useHttpAuth($username, $password)->call();

Use response content type

    $result = (new RestClient())->requestParams(RestClient::PATCH, $url, $data)->useResponseContentType()->call();

Get result in stdClass

    $result = (new RestClient())->requestParams(RestClient::PUT, $url, $data)->usePost()->call(true);

Enjoy, guys!

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2015-09-09