我正在使用带有react native的Woocommerce rest api。我试图获得所有类别的列表,但我得到了最多10个项目。
const WooCommerce = new WooCommerceRestApi({url: "xxxxxs", // Your store URL
ssl: true,
consumerKey: "xxxxx", // Your consumer secret
consumerSecret: "xxxxxx", // Your consumer secret
wpAPI: true, // Enable the WP REST API
integration version: "wc/v3", // WooCommerce WP REST API version
queryStringAuth: true,})
const categories = await WooCommerce.get( "products/categories?per_page=50")
console.log(categories)
我得到的回应是:
发布于 2021-10-23 18:19:30
您需要以这种方式传递参数:
...
parameters = {}
parameters[per_page] = 1
categories = await WooCommerce.get("products/categories/", params=parameters)
https://stackoverflow.com/questions/69688868
复制相似问题