Skip to content

Commit

Permalink
Form data support: POST body can be hydrated from request
Browse files Browse the repository at this point in the history
  • Loading branch information
janbarasek authored Nov 23, 2020
1 parent 1455ff3 commit 3231435
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ApiManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ private function getHttpMethod(): string
private function getBodyParams(string $method): array
{
if ($method !== 'GET' && $method !== 'DELETE') {
$return = [];
$return = (array) $this->request->getPost();
if (\count($_POST) === 1 && preg_match('/^\{.*\}$/', $post = array_keys($_POST)[0]) && is_array($json = json_decode($post, true)) === true) {
foreach ($json as $key => $value) {
$return[$key] = $value;
Expand Down

0 comments on commit 3231435

Please sign in to comment.