WooCommerce-REST-API-Client-Library
WooCommerce-REST-API-Client-Library copied to clipboard
i got -1 on getProducts
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
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' ...