\Guzzle\Service\Command\LocationVisitor\RequestJsonVisitor

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

Summary

Methods
Properties
Constants
after()
visit()
__construct()
setContentTypeHeader()
No public properties found
No constants found
prepareValue()
resolveRecursively()
$jsonContentType
$data
N/A
No private methods found
No private properties found
N/A

Properties

$jsonContentType

$jsonContentType : boolean

Type

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

$data

$data : \SplObjectStorage

Type

\SplObjectStorage — Data object for persisting JSON data

Methods

__construct()

__construct() 

setContentTypeHeader()

setContentTypeHeader(string  $header = 'application/json') : self

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.

Parameters

string $header

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

Returns

self

prepareValue()

prepareValue(mixed  $value, \Guzzle\Service\Description\Parameter  $param) : array|mixed

Prepare (filter and set desired name for request item) the value for request.

Parameters

mixed $value
\Guzzle\Service\Description\Parameter $param

Returns

array|mixed

resolveRecursively()

resolveRecursively(array  $value, \Guzzle\Service\Description\Parameter  $param) : array

Map nested parameters into the location_key based parameters

Parameters

array $value

Value to map

\Guzzle\Service\Description\Parameter $param

Parameter that holds information about the current key

Returns

array —

Returns the mapped array