Overview

Namespaces

  • Guzzle
    • Batch
      • Exception
    • Cache
    • Common
      • Exception
    • Http
      • Curl
      • Exception
      • Message
        • Header
      • QueryAggregator
    • Inflection
    • Iterator
    • Log
    • Parser
      • Cookie
      • Message
      • UriTemplate
      • Url
    • Plugin
      • Async
      • Backoff
      • Cache
      • Cookie
        • CookieJar
        • Exception
      • CurlAuth
      • ErrorResponse
        • Exception
      • History
      • Log
      • Md5
      • Mock
      • Oauth
    • Service
      • Builder
      • Command
        • Factory
        • LocationVisitor
          • Request
          • Response
      • Description
      • Exception
      • Resource
    • Stream
    • Tests
      • Batch
      • Cache
      • Common
        • Cache
        • Exception
      • Http
        • Curl
        • Exception
        • Message
          • Header
      • Inflection
      • Iterator
      • Log
      • Message
      • Mock
      • Parser
        • Cookie
        • Message
      • Parsers
        • UriTemplate
      • Plugin
        • Async
        • Backoff
        • Cache
        • Cookie
          • CookieJar
        • CurlAuth
        • ErrorResponse
        • History
        • Log
        • Md5
        • Mock
        • Oauth
        • Redirect
      • Service
        • Builder
        • Command
          • LocationVisitor
            • Request
            • Response
        • Description
        • Exception
        • Mock
          • Command
            • Sub
          • Model
        • Resource
      • Stream
  • None
  • Omnipay
    • Common
      • Exception
      • Message
    • Dummy
      • Message
    • VivaPayments
      • Message
  • PHP

Classes

  • AbstractEntityBodyDecorator
  • CachingEntityBody
  • Client
  • EntityBody
  • IoEmittingEntityBody
  • Mimetypes
  • QueryString
  • ReadLimitEntityBody
  • RedirectPlugin
  • StaticClient
  • Url

Interfaces

  • ClientInterface
  • EntityBodyInterface
  • Overview
  • Namespace
  • Class
  • Tree

Class RedirectPlugin

Plugin to implement HTTP redirects. Can redirect like a web browser or using strict RFC 2616 compliance

Guzzle\Http\RedirectPlugin implements Symfony\Component\EventDispatcher\EventSubscriberInterface
Namespace: Guzzle\Http
Located at src/Guzzle/Http/RedirectPlugin.php
Methods summary
public static
# getSubscribedEvents( )
public
# cleanupRequest( Guzzle\Common\Event $event )

Clean up the parameters of a request when it is cloned

Clean up the parameters of a request when it is cloned

Parameters

$event
Event emitted
public
# onRequestSent( Guzzle\Common\Event $event )

Called when a request receives a redirect response

Called when a request receives a redirect response

Parameters

$event
Event emitted
protected Guzzle\Http\Message\RequestInterface
# getOriginalRequest( Guzzle\Http\Message\RequestInterface $request )

Get the original request that initiated a series of redirects

Get the original request that initiated a series of redirects

Parameters

$request
Request to get the original request from

Returns

Guzzle\Http\Message\RequestInterface
protected Guzzle\Http\Message\RequestInterface
# createRedirectRequest( Guzzle\Http\Message\RequestInterface $request, Guzzle\Http\Message\RequestInterface $statusCode, integer $location, Guzzle\Http\Message\RequestInterface $original )

Create a redirect request for a specific request object

Create a redirect request for a specific request object

Takes into account strict RFC compliant redirection (e.g. redirect POST with POST) vs doing what most clients do (e.g. redirect POST with GET).

Parameters

$request
Request being redirected
$statusCode
$original Original request
$location
$statusCode Status code of the redirect
$original
$location Location header of the redirect

Returns

Guzzle\Http\Message\RequestInterface
Returns a new redirect request

Throws

Guzzle\Http\Exception\CouldNotRewindStreamException
If the body needs to be rewound but cannot
protected Guzzle\Http\Message\RequestInterface
# prepareRedirection( Guzzle\Http\Message\RequestInterface $original, Guzzle\Http\Message\RequestInterface $request, Guzzle\Http\Message\Response $response )

Prepare the request for redirection and enforce the maximum number of allowed redirects per client

Prepare the request for redirection and enforce the maximum number of allowed redirects per client

Parameters

$original
Original request
$request
Request to prepare and validate
$response
The current response

Returns

Guzzle\Http\Message\RequestInterface
protected
# sendRedirectRequest( Guzzle\Http\Message\RequestInterface $original, Guzzle\Http\Message\RequestInterface $request, Guzzle\Http\Message\Response $response )

Send a redirect request and handle any errors

Send a redirect request and handle any errors

Parameters

$original
The originating request
$request
The current request being redirected
$response
The response of the current request

Throws

Guzzle\Http\Exception\BadResponseException|Exception
protected
# throwTooManyRedirectsException( Guzzle\Http\Message\RequestInterface $original, integer $max )

Throw a too many redirects exception for a request

Throw a too many redirects exception for a request

Parameters

$original
Request
$max
Max allowed redirects

Throws

Guzzle\Http\Exception\TooManyRedirectsException
when too many redirects have been issued
Constants summary
string REDIRECT_COUNT
# 'redirect.count'
string MAX_REDIRECTS
# 'redirect.max'
string STRICT_REDIRECTS
# 'redirect.strict'
string PARENT_REQUEST
# 'redirect.parent_request'
string DISABLE
# 'redirect.disable'
Properties summary
protected integer $defaultMaxRedirects

Default number of redirects allowed when no setting is supplied by a request

Default number of redirects allowed when no setting is supplied by a request

# 5
Omnipay Viva Payments Gateway Module API Documentation API documentation generated by ApiGen