Skip to content

Commit

Permalink
GetBodyParams: Add support for file uploading.
Browse files Browse the repository at this point in the history
  • Loading branch information
janbarasek authored Jan 6, 2021
1 parent 3b5762c commit 5e38aad
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 @@ -288,7 +288,7 @@ private function invokeActionMethod(Endpoint $endpoint, string $methodName, stri
private function getBodyParams(string $method): array
{
if ($method !== 'GET' && $method !== 'DELETE') {
$return = (array) $this->request->getPost();
$return = array_merge((array) $this->request->getPost(), $this->request->getFiles());
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 5e38aad

Please sign in to comment.