Skip to content

Commit

Permalink
20.4.4 SHQ23-365 Move from Zend_Http to Laminas_Http
Browse files Browse the repository at this point in the history
  • Loading branch information
wsajosh committed Mar 22, 2023
1 parent d5e88cf commit 6d352c2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG-PUBLIC.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,7 @@ MNB-2576 Rolled back MNB-2405
MNB-2405 added RMSItem.name field


## 20.4.4 (2023-03-22)
SHQ23-365 Move from Zend_Http to Laminas_Http


4 changes: 4 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,7 @@ MNB-2576 Rolled back MNB-2405
MNB-2405 added RMSItem.name field


## 20.4.4 (2023-03-22)
SHQ23-365 Move from Zend_Http to Laminas_Http


2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "shipperhq/library-graphql",
"description": "ShipperHQ GraphQL Library",
"type": "magento2-library",
"version": "20.4.3",
"version": "20.4.4",
"license": [
"OSL-3.0",
"AFL-3.0"
Expand Down
12 changes: 6 additions & 6 deletions src/Client/AbstractClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

namespace ShipperHQ\GraphQL\Client;

use Laminas\Http\Client;
use Laminas\Http\Request;
use ShipperHQ\GraphQL\Helpers\Serializer;
use ShipperHQ\GraphQL\Request\AbstractHeaders;

Expand Down Expand Up @@ -49,15 +51,13 @@ protected function sendRequest($serializedRequest, $responseClassName, $endpoint

try {
if ($useZendClient) {
$client = new \Zend_Http_Client(
$endpoint,
$args
);
$client = new Client($endpoint, $args);
if ($headers) {
$client->setHeaders($headers->toArray());
}
$client->setRawData($serializedRequest, 'application/json');
$response = $client->request(\Zend_Http_Client::POST);
$client->setRawBody($serializedRequest);
$client->setEncType('application/json');
$response = $client->setMethod(Request::METHOD_POST)->send();
if ($response !== null) {
$responseBody = $response->getBody() ?: "{}";
}
Expand Down

0 comments on commit 6d352c2

Please sign in to comment.