Class Http

Summary

Fully Qualified Name: Zend\XmlRpc\Request\Http
Extends: Request

Description

XmlRpc Request object -- Request via HTTP

Extends {@link Zend\XmlRpc\Request} to accept a request via HTTP. Request is built at construction time using a raw POST; if no data is available, the request is declared a fault.

Methods

Name Description Defined By
__construct() Constructor Http
__toString() Return XML request Request
addParam() Add a parameter to the parameter stack Request
getEncoding() Retrieve current request encoding Request
getFault() Retrieve the fault response, if any Request
getFullRequest() Retrieve the full HTTP request, including headers and XML Http
getHeaders() Get headers Http
getMethod() Retrieve call method Request
getParams() Retrieve the array of parameters Request
getRawRequest() Retrieve the raw XML request Http
getTypes() Return parameter types Request
isFault() Does the current request contain errors and should it return a fault response? Request
loadXml() Load XML and parse into request components Request
saveXml() Create XML request Request
setEncoding() Set encoding to use in request Request
setMethod() Set method to call Request
setParams() Set the parameters array Request

Method Details

__construct()

Constructor

Attempts to read from php://input to get raw POST request; if an error occurs in doing so, or if the XML is invalid, the request is declared a fault.

Returns:

__toString()

Return XML request

Returns: string

addParam()

Add a parameter to the parameter stack

Adds a parameter to the parameter stack, associating it with the type $type if provided

Parameter Name Type Description
$value mixed
$type string Optional;

Returns: void

getEncoding()

Retrieve current request encoding

Returns: string

getFault()

Retrieve the fault response, if any

Returns: null|\Zend\XmlRpc\Fault

getFullRequest()

Retrieve the full HTTP request, including headers and XML

Returns: string

getHeaders()

Get headers

Gets all headers as key => value pairs and returns them.

Returns: array

getMethod()

Retrieve call method

Returns: string

getParams()

Retrieve the array of parameters

Returns: array

getRawRequest()

Retrieve the raw XML request

Returns: string

getTypes()

Return parameter types

Returns: array

isFault()

Does the current request contain errors and should it return a fault response?

Returns: bool

loadXml()

Load XML and parse into request components

Parameter Name Type Description
$request string

Returns: bool True on success, false if an error occurred.

saveXml()

Create XML request

Returns: string

setEncoding()

Set encoding to use in request

Parameter Name Type Description
$encoding string

Returns: \Zend\XmlRpc\Request

setMethod()

Set method to call

Parameter Name Type Description
$method string

Returns: bool Returns true on success, false if method name is invalid

setParams()

Set the parameters array

If called with a single, array value, that array is used to set the parameters stack. If called with multiple values or a single non-array value, the arguments are used to set the parameters stack.

Best is to call with array of the format, in order to allow type hinting when creating the XMLRPC values for each parameter: $array = array(

array(
    'value' => $value,
    'type'  => $type
)[, ... ]

);

Returns: void

Top