Fix Shopify API connection on local Windows dev server
Add SSL_VERIFYPEER option to cURL to fix HTTP 0 errors when running with PHP built-in server on Windows. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
f3f302513e
commit
9396ae4e02
1 changed files with 1 additions and 0 deletions
|
|
@ -43,6 +43,7 @@ function fetchShopifyProducts(): array
|
||||||
$ch = curl_init($endpoint);
|
$ch = curl_init($endpoint);
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
curl_setopt($ch, CURLOPT_POST, true);
|
curl_setopt($ch, CURLOPT_POST, true);
|
||||||
|
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // Nécessaire pour dev local sur Windows
|
||||||
curl_setopt($ch, CURLOPT_HTTPHEADER, [
|
curl_setopt($ch, CURLOPT_HTTPHEADER, [
|
||||||
'Content-Type: application/json',
|
'Content-Type: application/json',
|
||||||
'X-Shopify-Storefront-Access-Token: ' . $token
|
'X-Shopify-Storefront-Access-Token: ' . $token
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue