API Response Headers
-
I am putting a request that pulls a list of orders via the API in PHP.
I am having a lot of difficulty in accessing the X-WP-TotalPages in the header.
Is there anyone who can point me in the right direction!
ThanksHere is the code I am using at the moment;
require($_SERVER["DOCUMENT_ROOT"] . "/vendor/autoload.php"); use Automattic\WooCommerce\Client; $woocommerce = new Client( 'http://example.com', '*****************************', '*****************************', [ 'wp_api' => true, 'version' => 'wc/v1', ] ); $endpoint = 'orders'; $options = ['filter[limit]' => '200', 'filter[period]' => 'year', 'filter[order]' => 'ASC', 'status' => 'processing']; $result = $woocommerce->get($endpoint, $options);I need something like this;
print_r(get_headers($result));
Bu that is just not working or any number of variations I have tried!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘API Response Headers’ is closed to new replies.