From 4d25cbc0e0b8b6580720dc21e4d9edc023a5bc0a Mon Sep 17 00:00:00 2001 From: Amanda Saffer Date: Mon, 2 Apr 2018 17:13:07 -0600 Subject: [PATCH] Add Content-Length header To prevent Shopify from throwing 411 Length Required error. --- src/RocketCode/Shopify/API.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/RocketCode/Shopify/API.php b/src/RocketCode/Shopify/API.php index 10182e8..409928b 100644 --- a/src/RocketCode/Shopify/API.php +++ b/src/RocketCode/Shopify/API.php @@ -221,6 +221,7 @@ public function call($userData = array(), $verifyData = TRUE) $defaultHeaders = array(); $defaultHeaders[] = 'Content-Type: application/json; charset=' . $request['CHARSET']; $defaultHeaders[] = 'Accept: application/json'; + $defaultHeaders[] = 'Content-length: 0'; if (array_key_exists('ACCESS_TOKEN', $this->_API)) { $defaultHeaders[] = 'X-Shopify-Access-Token: ' . $this->_API['ACCESS_TOKEN']; @@ -333,4 +334,4 @@ public function call($userData = array(), $verifyData = TRUE) } -} // End of API class \ No newline at end of file +} // End of API class