Class Guzzle\Service\Command\LocationVisitor\Request\JsonVisitor

InheritanceGuzzle\Service\Command\LocationVisitor\Request\JsonVisitor » Guzzle\Service\Command\LocationVisitor\Request\AbstractRequestVisitor
ImplementsGuzzle\Service\Command\LocationVisitor\Request\RequestVisitorInterface

Visitor used to apply a parameter to an array that will be serialized as a top level key-value pair in a JSON body

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$data SplObjectStorage Data object for persisting JSON data Guzzle\Service\Command\LocationVisitor\Request\JsonVisitor
$jsonContentType bool Whether or not to add a Content-Type header when JSON is found Guzzle\Service\Command\LocationVisitor\Request\JsonVisitor

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__construct() Guzzle\Service\Command\LocationVisitor\Request\JsonVisitor
after() Guzzle\Service\Command\LocationVisitor\Request\JsonVisitor
setContentTypeHeader() Set the Content-Type header to add to the request if JSON is added to the body. This visitor does not add a Content-Type header unless you specify one here. Guzzle\Service\Command\LocationVisitor\Request\JsonVisitor
visit() Guzzle\Service\Command\LocationVisitor\Request\JsonVisitor

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
prepareValue() Prepare (filter and set desired name for request item) the value for request. Guzzle\Service\Command\LocationVisitor\Request\AbstractRequestVisitor
resolveRecursively() Map nested parameters into the location_key based parameters Guzzle\Service\Command\LocationVisitor\Request\AbstractRequestVisitor

Property Details

$data protected property

Data object for persisting JSON data

protected SplObjectStorage $data null
$jsonContentType protected property

Whether or not to add a Content-Type header when JSON is found

protected bool $jsonContentType 'application/json'

Method Details

__construct() public method

public void __construct ( )
after() public method

public void after ( Guzzle\Service\Command\CommandInterface $command, Guzzle\Http\Message\RequestInterface $request )
$command
$request
setContentTypeHeader() public method

Set the Content-Type header to add to the request if JSON is added to the body. This visitor does not add a Content-Type header unless you specify one here.

public self setContentTypeHeader ( $header 'application/json' )
$header string

Header to set when JSON is added (e.g. application/json)

visit() public method

public void visit ( Guzzle\Service\Command\CommandInterface $command, Guzzle\Http\Message\RequestInterface $request, Guzzle\Service\Description\Parameter $param, $value )
$command
$request
$param
$value