Uses the Wordpress Requests library to fetch results from the CultureHosts API. Manages Oauth tokens automatically, using a Token_Store.
| Methods | ||
|---|---|---|
public
|
__construct(
string $api_root,
string $oauth_endpoint,
string $oauth_client_id,
string $oauth_client_secret,
Token_Store $token_store,
)
|
# |
public
|
get(string $endpoint, array|int $args = []): Response|null
|
# |
public
|
post(string $endpoint, array|int $args, array $files = null): Response|null
|
# |
public
|
patch(string $endpoint, array|int $args, array $files = null): Response|null
|
# |
public
|
delete(string $endpoint, array|int $args = []): Response|null
|
# |
public
|
get_request_options(): array
|
# |
public
|
get_request_headers(): array
|
# |
public
|
set_request_options(array $request_options): void
|
# |
public
|
set_request_headers(array $request_headers): void
|
# |