This commit is contained in:
2020-10-30 01:26:42 +08:00
parent 91550401e3
commit 66f35513c2
+3 -2
View File
@@ -6,6 +6,7 @@
* Time: 14:54 * Time: 14:54
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace HttpServer\Http; namespace HttpServer\Http;
use Exception; use Exception;
@@ -38,13 +39,13 @@ class HttpParams
*/ */
public function __construct($body, $get, $files) public function __construct($body, $get, $files)
{ {
$this->body = $body;
$this->gets = $get ?? []; $this->gets = $get ?? [];
$this->files = $files ?? []; $this->files = $files ?? [];
if (!is_array($this->body)) { if (!is_array($this->body)) {
$this->body = Help::toArray($this->body); $this->body = Help::toArray($this->body);
} else {
$this->body = $body;
} }
} }
/** /**