core/model/modx/jsonrpc/modjsonrpcresponse.class.php
- Package
- modx
- Subpackage
- jsonrpc
\modJSONRPCResponse
Extends modXMLRPCResponse to support servicing JSON-RPC client requests.
Includes functions to manipluate header data, such as status codes, as well as manipulating the response body.
- Parent(s)
- \modXMLRPCResponse < \modResponse
Properties
string
$body= 'null'
null
Details- Type
- string
- Inherited_from
- \modResponse::$$body
- Inherited_from
- \modXMLRPCResponse::$$body
\modContentType
$contentType= 'null'
The current content type on the resource
Inherited from: \modResponse::$$contentType\modXMLRPCResponse::$$contentTypenull
Details- Type
- \modContentType
- Inherited_from
- \modResponse::$$contentType
- Inherited_from
- \modXMLRPCResponse::$$contentType
string
$header= 'null'
The HTTP header for this Response
Inherited from: \modResponse::$$header\modXMLRPCResponse::$$headernull
Details- Type
- string
- Inherited_from
- \modResponse::$$header
- Inherited_from
- \modXMLRPCResponse::$$header
\modX
$modx= 'null'
A reference to the modX instance
Inherited from: \modResponse::$$modx\modXMLRPCResponse::$$modxnull
Details- Type
- \modX
- Inherited_from
- \modResponse::$$modx
- Inherited_from
- \modXMLRPCResponse::$$modx
\xmlrpc_server
$server= 'null'
null
Details- Type
- \xmlrpc_server
- Access
- public
- Inherited_from
- \modXMLRPCResponse::$$server
array
$services= 'array ()'
A collection of services attached to this response
Inherited from: \modXMLRPCResponse::$$servicesarray ()
Details- Type
- array
- Access
- public
- Inherited_from
- \modXMLRPCResponse::$$services
Methods
__construct(
\modX $modx
)
:
void
Name | Type | Description |
---|---|---|
$modx | \modX | A reference to the modX instance |
checkPreview(
)
:
boolean
Checks to see if the preview parameter is set.
Inherited from: \modResponse::checkPreview()\modXMLRPCResponse::checkPreview()Type | Description |
---|---|
boolean |
getServer(
bool $execute
=
false
)
:
bool
Load the JSON-RPC server
Name | Type | Description |
---|---|---|
$execute | bool | Execute the server process |
Type | Description |
---|---|
bool | True if the server was successfully loaded |
outputContent(
array $options
=
array()
)
:
void
Output the content of this response
Name | Type | Description |
---|---|---|
$options | array | An array of options for the output |
registerService(
string $key, string $signature
)
:
void
Name | Type | Description |
---|---|---|
$key | string | The name of the service |
$signature | string | The signature of the service |
- Access
- public
sendRedirect(
string $url, array | boolean $options
=
false, string $type
=
'', string $responseCode
=
''
)
:
void | boolean
Sends a redirect to the specified URL using the specified method.
Inherited from: \modResponse::sendRedirect()\modXMLRPCResponse::sendRedirect()Valid $type values include: REDIRECT_REFRESH Uses the header refresh method REDIRECT_META Sends a a META HTTP-EQUIV="Refresh" tag to the output REDIRECT_HEADER Uses the header location method
REDIRECT_HEADER is the default.
Name | Type | Description |
---|---|---|
$url | string | The URL to redirect the client browser to. |
$options | array | boolean | An array of options for the redirect OR indicates if redirect attempts should be counted and limited to 3 (latter is deprecated usage; use count_attempts in options array). |
$type | string | The type of redirection to attempt (deprecated, use type in options array). |
$responseCode | string | The type of HTTP response code HEADER to send for the redirect (deprecated, use responseCode in options array) |
Type | Description |
---|---|
void | boolean |
unregisterService(
string $key
)
:
void
Unregisters a service from this response
Inherited from: \modXMLRPCResponse::unregisterService()Name | Type | Description |
---|---|---|
$key | string | The name of the service |
- Access
- public