Documentation

Options

REST API HTTP Client Options class.

Table of Contents

TIMEOUT  = 15
Default request timeout.
USER_AGENT  = 'WooCommerce API Client-PHP'
Default User Agent.
VERSION  = 'wc/v3'
Default WooCommerce REST API version.
WP_API_PREFIX  = '/wp-json/'
Default WP API prefix.
$options  : array<string|int, mixed>
Options.
__construct()  : mixed
Initialize HTTP client options.
apiPrefix()  : string
Custom API Prefix for WP API.
getFollowRedirects()  : bool
Get follow redirects
getTimeout()  : int
Get timeout.
getVersion()  : string
Get API version.
isQueryStringAuth()  : bool
Basic Authentication as query string.
isWPAPI()  : bool
Check if is WP REST API.
oauthTimestamp()  : string
oAuth timestamp.
userAgent()  : string
Custom user agent.
verifySsl()  : bool
Check if need to verify SSL.

Constants

TIMEOUT

Default request timeout.

public mixed TIMEOUT = 15

USER_AGENT

Default User Agent.

public mixed USER_AGENT = 'WooCommerce API Client-PHP'

No version number.

VERSION

Default WooCommerce REST API version.

public mixed VERSION = 'wc/v3'

WP_API_PREFIX

Default WP API prefix.

public mixed WP_API_PREFIX = '/wp-json/'

Including leading and trailing slashes.

Properties

$options

Options.

private array<string|int, mixed> $options

Methods

__construct()

Initialize HTTP client options.

public __construct(array<string|int, mixed> $options) : mixed
Parameters
$options : array<string|int, mixed>

Client options.

Return values
mixed

apiPrefix()

Custom API Prefix for WP API.

public apiPrefix() : string
Return values
string

getFollowRedirects()

Get follow redirects

public getFollowRedirects() : bool
Return values
bool

getTimeout()

Get timeout.

public getTimeout() : int
Return values
int

getVersion()

Get API version.

public getVersion() : string
Return values
string

isQueryStringAuth()

Basic Authentication as query string.

public isQueryStringAuth() : bool

Some old servers are not able to use CURLOPT_USERPWD.

Return values
bool

isWPAPI()

Check if is WP REST API.

public isWPAPI() : bool
Return values
bool

oauthTimestamp()

oAuth timestamp.

public oauthTimestamp() : string
Return values
string

userAgent()

Custom user agent.

public userAgent() : string
Return values
string

verifySsl()

Check if need to verify SSL.

public verifySsl() : bool
Return values
bool

Search results