encore-labs / guzzle-bundle-header-forward-plugin
一个Guzzle插件,允许您自动将当前请求的头部信息转发到Guzzle请求中。已分支以支持Symfony 4
v3.0.1
2020-03-24 09:07 UTC
Requires
- php: ^7.1
- eightpoints/guzzle-bundle: ~8.0
- guzzlehttp/guzzle: ^6.0
- symfony/config: ~4.0
- symfony/dependency-injection: ~4.0
- symfony/expression-language: ~4.0
- symfony/http-kernel: ~4.0
Requires (Dev)
- phpunit/phpunit: ~6.1
This package is not auto-updated.
Last update: 2024-09-18 08:08:46 UTC
README
# Guzzle Bundle Header Forwarding Plugin
此插件提供了一种将当前Symfony请求的头部信息转发到cURL的方法。
要求
- PHP 7.0 或更高版本
- Guzzle Bundle
安装
使用 composer
composer.json
{ "require": { "encore-labs/guzzle-bundle-header-forward-plugin": "^1.0" } }
命令行
$ composer require encore-labs/guzzle-bundle-header-forward-plugin
使用方法
启用插件
# app/AppKernel.php new EightPoints\Bundle\GuzzleBundle\EightPointsGuzzleBundle([ new EncoreLabs\Bundle\GuzzleBundleHeaderForwardPlugin\GuzzleBundleHeaderForwardPlugin(), ])
基本配置
# app/config/config.yml eight_points_guzzle: clients: api_payment: base_url: "http://api.domain.tld" # define headers, options # plugin settings plugin: header_forward: enabled: true headers: - 'Accept-Language'