php-shopify icon indicating copy to clipboard operation
php-shopify copied to clipboard

Allow custom HTTP client and add Guzzle adapter

Open npabisz opened this issue 4 months ago • 1 comments

This PR add more flexibility to the library allowing to use custom HTTP clients, like Guzzle. There is also simple GuzzleAdapter added so developers don't need to write their own and start using package right away. By dafault it still uses cURL , however its wrapped in CurlAdapter. Both are implementing HttpClient interface.

$client = new GuzzleHttp\Client();
$config = array(
    // ...  
    'HttpClient' => new PHPShopify\GuzzleAdapter($client)
);

PHPShopify\ShopifySDK::config($config);

npabisz avatar Jul 17 '25 00:07 npabisz