Documentation

ClientUtils
in package

Handle Real Product Manager API calls (Utilities).

Table of Contents

Constants

ERROR_CODE_CLIENT_PARSE  = 'rpm_wpc_client_parse'
ERROR_CODE_REMOTE  = 'rpm_wpc_remote'

Methods

parseResponse()  : WP_Error|array<string|int, mixed>
Parse response as JSON or return `WP_Error` on failures.
request()  : mixed
`POST` (or `PUT`, `GET`, ...) data to the remote host.

Constants

ERROR_CODE_CLIENT_PARSE

public mixed ERROR_CODE_CLIENT_PARSE = 'rpm_wpc_client_parse'

ERROR_CODE_REMOTE

public mixed ERROR_CODE_REMOTE = 'rpm_wpc_remote'

Methods

parseResponse()

Parse response as JSON or return `WP_Error` on failures.

public static parseResponse(WP_Error|array<string|int, mixed> $response) : WP_Error|array<string|int, mixed>
Parameters
$response : WP_Error|array<string|int, mixed>
Return values
WP_Error|array<string|int, mixed>

request()

`POST` (or `PUT`, `GET`, ...) data to the remote host.

public static request(AbstractInitiator $initiator, string $endpoint[, array<string|int, mixed> $body = null ][, string $method = 'GET' ]) : mixed
Parameters
$initiator : AbstractInitiator
$endpoint : string
$body : array<string|int, mixed> = null
$method : string = 'GET'

        
On this page

Search results