承接 polysource/adapter-http 相关项目开发

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

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

polysource/adapter-http

最新稳定版本:v0.1.3

Composer 安装命令:

composer require polysource/adapter-http

包简介

Polysource — HTTP REST API adapter: list, browse, write external API resources through the admin (with cursor or page-based pagination strategies).

README 文档

README

HTTP REST API adapter for Polysource — admin Stripe, GitHub, internal microservices, any external REST API you operate but don't own the schema of.

Part of the Polysource monorepo. MIT-licensed.

What it ships

  • HttpDataSource — implements WritableDataSourceInterface over Symfony HttpClientInterface.
  • PaginationStrategyInterface — pluggable pagination protocol with two built-in implementations:
    • PageNumberPaginationStrategy?page=N style (Stripe-like)
    • CursorPaginationStrategy — opaque cursor in response (GitHub-like)
  • defaultHeaders constructor arg for injecting auth headers (Bearer tokens, API keys).
  • HttpResource — non-final convenience base.
  • Tested with Symfony's MockHttpClient so no live API calls in CI.

Install

composer require polysource/adapter-http symfony/http-client

Register the bundle:

return [
    Polysource\Adapter\Http\PolysourceAdapterHttpBundle::class => ['all' => true],
];

Extend it

For an API that paginates in an unusual way (link headers, X-Pagination, RFC 5988…), implement PaginationStrategyInterface (2 methods):

final class LinkHeaderPaginationStrategy implements PaginationStrategyInterface
{
    public function buildRequest(DataQuery $query): array { /* return query + headers */ }
    public function parseResponse(ResponseInterface $response): DataPage { /* parse Link header */ }
}

Inject into HttpDataSource. No fork needed. See extensibility map.

Documentation

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固