Client
in package
REST API Client class.
Table of Contents
- VERSION = '3.0.0'
- WooCommerce REST API Client version.
- $http : HttpClient
- HttpClient instance.
- __construct() : mixed
- Initialize client.
- delete() : array<string|int, mixed>
- DELETE method.
- get() : array<string|int, mixed>
- GET method.
- options() : array<string|int, mixed>
- OPTIONS method.
- post() : array<string|int, mixed>
- POST method.
- put() : array<string|int, mixed>
- PUT method.
Constants
VERSION
WooCommerce REST API Client version.
public
mixed
VERSION
= '3.0.0'
Properties
$http
HttpClient instance.
public
HttpClient
$http
Methods
__construct()
Initialize client.
public
__construct(string $url, string $consumerKey, string $consumerSecret[, array<string|int, mixed> $options = [] ]) : mixed
Parameters
- $url : string
-
Store URL.
- $consumerKey : string
-
Consumer key.
- $consumerSecret : string
-
Consumer secret.
- $options : array<string|int, mixed> = []
-
Options (version, timeout, verify_ssl).
Return values
mixed —delete()
DELETE method.
public
delete(string $endpoint[, array<string|int, mixed> $parameters = [] ]) : array<string|int, mixed>
Parameters
- $endpoint : string
-
API endpoint.
- $parameters : array<string|int, mixed> = []
-
Request parameters.
Return values
array<string|int, mixed> —get()
GET method.
public
get(string $endpoint[, array<string|int, mixed> $parameters = [] ]) : array<string|int, mixed>
Parameters
- $endpoint : string
-
API endpoint.
- $parameters : array<string|int, mixed> = []
-
Request parameters.
Return values
array<string|int, mixed> —options()
OPTIONS method.
public
options(string $endpoint) : array<string|int, mixed>
Parameters
- $endpoint : string
-
API endpoint.
Return values
array<string|int, mixed> —post()
POST method.
public
post(string $endpoint, array<string|int, mixed> $data) : array<string|int, mixed>
Parameters
- $endpoint : string
-
API endpoint.
- $data : array<string|int, mixed>
-
Request data.
Return values
array<string|int, mixed> —put()
PUT method.
public
put(string $endpoint, array<string|int, mixed> $data) : array<string|int, mixed>
Parameters
- $endpoint : string
-
API endpoint.
- $data : array<string|int, mixed>
-
Request data.