wizbit/guzzle-bundle-middleware-plugin

A generic middleware plugin for Guzzle Bundle, a PHP HTTP client library and framework for building RESTful web service clients

2.0.0 2020-05-08 16:47 UTC

This package is auto-updated.

Last update: 2024-11-12 22:29:37 UTC


README

This plugin integrates a generic way to include all middleware.

Requirements

Installation

Using composer:

command line
$ composer require wizbit/guzzle-bundle-middleware-plugin

Usage

Enable bundle

# app/AppKernel.php

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

Basic configuration

# 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'