\GuzzleHttp\Command\Guzzle\RequestLocationJsonLocation

Creates a JSON document

Summary

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

Properties

$locationName

$locationName : string

Type

string

$jsonContentType

$jsonContentType : string

Type

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

$jsonData

$jsonData : array

Type

array

Methods

__construct()

__construct(string  $locationName = 'json', string  $contentType = 'application/json') : mixed

Set the name of the location

Parameters

string $locationName

Name of the location

string $contentType

Content-Type header to add to the request if JSON is added to the body. Pass an empty string to omit.

Returns

mixed —

visit()

visit(\GuzzleHttp\Command\CommandInterface  $command, \Psr\Http\Message\RequestInterface  $request, \GuzzleHttp\Command\Guzzle\Parameter  $param) : \Psr\Http\Message\RequestInterface

Visits a location for each top-level parameter

Parameters

\GuzzleHttp\Command\CommandInterface $command
\Psr\Http\Message\RequestInterface $request
\GuzzleHttp\Command\Guzzle\Parameter $param

Returns

\Psr\Http\Message\RequestInterface —

after()

after(\GuzzleHttp\Command\CommandInterface  $command, \Psr\Http\Message\RequestInterface  $request, \GuzzleHttp\Command\Guzzle\Operation  $operation) : \Psr\Http\Message\MessageInterface

Called when all of the parameters of a command have been visited.

Parameters

\GuzzleHttp\Command\CommandInterface $command
\Psr\Http\Message\RequestInterface $request
\GuzzleHttp\Command\Guzzle\Operation $operation

Returns

\Psr\Http\Message\MessageInterface —

prepareValue()

prepareValue(mixed  $value, \GuzzleHttp\Command\Guzzle\Parameter  $param) : array|mixed

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

Parameters

mixed $value
\GuzzleHttp\Command\Guzzle\Parameter $param

Returns

array|mixed —

resolveRecursively()

resolveRecursively(array  $value, \GuzzleHttp\Command\Guzzle\Parameter  $param) : array

Recursively prepare and filter nested values.

Parameters

array $value

Value to map

\GuzzleHttp\Command\Guzzle\Parameter $param

Parameter related to the current key.

Returns

array —

Returns the mapped array