|
@@ -11,6 +11,7 @@ class SimpleRequest |
|
@@ -11,6 +11,7 @@ class SimpleRequest |
|
11
|
public string $method;
|
11
|
public string $method;
|
|
12
|
public array $header;
|
12
|
public array $header;
|
|
13
|
public array $cookie;
|
13
|
public array $cookie;
|
|
|
|
14
|
+ public string $rawContent;
|
|
14
|
|
15
|
|
|
15
|
public function __construct($data)
|
16
|
public function __construct($data)
|
|
16
|
{
|
17
|
{
|
|
@@ -21,5 +22,14 @@ class SimpleRequest |
|
@@ -21,5 +22,14 @@ class SimpleRequest |
|
21
|
$this->method = $data['method'];
|
22
|
$this->method = $data['method'];
|
|
22
|
$this->header = $data['header'];
|
23
|
$this->header = $data['header'];
|
|
23
|
$this->cookie = $data['cookie'];
|
24
|
$this->cookie = $data['cookie'];
|
|
|
|
25
|
+ $this->rawContent = $data['rawContent'];
|
|
|
|
26
|
+ if ($this->method == 'POST') {
|
|
|
|
27
|
+ if (count($this->post) == 0) {
|
|
|
|
28
|
+ $data = json_decode($this->rawContent, true);
|
|
|
|
29
|
+ if ($data) {
|
|
|
|
30
|
+ $this->post = $data;
|
|
|
|
31
|
+ }
|
|
|
|
32
|
+ }
|
|
|
|
33
|
+ }
|
|
24
|
}
|
34
|
}
|
|
25
|
} |
35
|
} |