wizbit/guzzle-bundle-middleware-plugin

这是一个通用的中间件插件,用于Guzzle Bundle,它是一个PHP HTTP客户端库和框架,用于构建RESTful Web服务客户端

2.0.0 2020-05-08 16:47 UTC

This package is auto-updated.

Last update: 2024-09-12 22:09:37 UTC


README

此插件以通用方式集成所有中间件。

要求

安装

使用 composer

命令行
$ composer require wizbit/guzzle-bundle-middleware-plugin

用法

启用包

# app/AppKernel.php

new EightPoints\Bundle\GuzzleBundle\EightPointsGuzzleBundle([
    new Wizbit\Bundle\GuzzleBundleMiddlewarePlugin\GuzzleBundleMiddlewarePlugin(),
])

基本配置

# app/config/config.yml

eight_points_guzzle:
    clients:
        api_payment:
            base_url: "http://api.domain.tld"

            # define headers, options

            # plugin settings
            plugin:
                middleware:
                    - '@my.middleware.service'