承接 ideasoft/batch-request-client 相关项目开发

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

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

ideasoft/batch-request-client

最新稳定版本:0.1.1

Composer 安装命令:

composer require ideasoft/batch-request-client

包简介

Batch request client implementation for php.

README 文档

README

http-batch-client allows to combine multiple http requests into a single batch request. This tool is useful for decrease http requests especially for api endpoints.

About multipart/batch

Http multipart/batch is a format for packaging multiple HTTP requests in a single request. You can read this draft more info: https://tools.ietf.org/id/draft-snell-http-batch-00.html

Installing http-batch-client

The easiest way to install http-batch-client is through composer.

composer require ideasoft/batch-request-client

Important Note:

This is only a client implementation. Your api service should supports batch request. If you are using Symfony 2.8+, you can use https://github.com/IdeasoftLabs/http-batch-bundle for server implementation.

How to use http-batch-client

You can create a batch request client and send your requests to batch endpoint and use it via client.

<?php

$client = new \BatchRequest\Client\Client();
$headers = [
    "Authorization" => "Bearer TOKEN"
];

$requests = [
    "users" => new \GuzzleHttp\Psr7\Request("GET", "http://your-api-url/users", ["Authorization" => "Bearer TOKEN"]),
    "orders" => new \GuzzleHttp\Psr7\Request("GET", "http://your-api-url/orders", ["Authorization" => "Bearer TOKEN"])
];

$data = $client->send("http://your-api-url/batch", $headers, $requests);
if ($data->getSubResponses()["users"]->getStatusCode()) {
    //sub request success for users 
}

统计信息

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

GitHub 信息

  • Stars: 23
  • Watchers: 2
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-12-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固