Skip to content

Commit

Permalink
[v1.1.4] add support for application/x-www-form-urlencoded
Browse files Browse the repository at this point in the history
  • Loading branch information
zepgram committed May 3, 2024
1 parent 1969793 commit cf972c5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Service/ApiProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ private function formatOptions(array $body, array $headers, bool $verify, string
} else {
$options['body'] = $this->isJsonRequest() ? $this->serializer->serialize($body) : $body;
}
$contentType = $headers['Content-Type'] ?? null;
if ($contentType === 'application/x-www-form-urlencoded') {
$options['form_params'] = $body;
}
$options['headers'] = $headers;
$options['verify'] = $verify;
$options['http_errors'] = true;
Expand Down
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": "zepgram/module-rest",
"description": "Technical module to industrialize API REST call with dependency injection pattern using Guzzle library",
"type": "magento2-module",
"version": "1.1.3",
"version": "1.1.4",
"authors": [
{
"name": "Benjamin Calef",
Expand Down

0 comments on commit cf972c5

Please sign in to comment.