WooCommerce-REST-API-Client-Library icon indicating copy to clipboard operation
WooCommerce-REST-API-Client-Library copied to clipboard

i got -1 on getProducts

Open Dewilas opened this issue 10 years ago • 1 comments

Hello,

i try to get products, but than i print_r() on this:

public function get_products( $params = array() ) { return $this->_make_api_call( 'products', $params ); }

got -1

Dewilas avatar Dec 01 '15 22:12 Dewilas

Read function documentation:

/** * Make the API call to specified endpoint with the given data -- also * handle decoding the JSON * * @since 2.0 * @param string $method HTTP method, e.g. GET * @param string $path request path, e.g. orders/123 * @param array $request_data either query parameters or the request body * @return object|array object by default * @throws Exception HTTP or authentication errors */

First parameter should be 'GET', second 'products' ...

prestaalba avatar Nov 13 '16 17:11 prestaalba