Problem with cURL and rest API
The curl_init function accepts an url and what you are passing there looks like a command line call. Please check this link for an example of passing username and password through php curl functionality. Basically you have to use just http://localhost/wp-json/wc/v1/products in curl_init and set username using curl_setopt function with CURLOPT_USERPWD parameter. Example: $ch = … Read more