m6web/request-headers-forwarder-guzzle-bundle

此包已弃用且不再维护。未建议替代包。

Symfony Bundle,用于从当前请求中获取一些HTTP头,并在Guzzle客户端子请求中重复使用。

v1.0.2 2017-11-30 15:15 UTC

This package is auto-updated.

Last update: 2022-03-27 14:01:43 UTC


README

Build Status

Symfony Bundle,用于从当前请求中获取一些HTTP头,并在Guzzle客户端子请求中重复使用。

“用例”之一可能是当你调用一个前端API,它会对另一个需要认证HTTP头的API进行子请求时... 使用此包,你可以使用认证头调用前端API,并让它无缝地将这些头转发到其他API。

配置

m6_web_request_headers_forwarder_guzzle:
    clients:
        test.guzzle1:                               # Guzzle client service id
            headers: ['x-auth-sample', 'something'] # Headers that will be forwarded to "test.guzzle1" client requests

services:
    test.guzzle1:
        class: 'GuzzleHttp\Client'

建议