qqq
This commit is contained in:
@@ -130,12 +130,13 @@ class OnRequest implements OnRequestInterface
|
|||||||
->withUploadedFiles($request->files ?? [])
|
->withUploadedFiles($request->files ?? [])
|
||||||
->withMethod($request->getMethod());
|
->withMethod($request->getMethod());
|
||||||
|
|
||||||
var_dump($request->header);
|
|
||||||
$contentType = $request->header['content-type'] ?? 'application/json';
|
$contentType = $request->header['content-type'] ?? 'application/json';
|
||||||
|
if ($request->getContent()) {
|
||||||
if (str_contains($contentType, 'json')) {
|
if (str_contains($contentType, 'json')) {
|
||||||
$serverRequest->withParsedBody(json_decode($request->post, true));
|
$serverRequest->withParsedBody(json_decode($request->getContent(), true));
|
||||||
} else if (str_contains($contentType, 'xml')) {
|
} else if (str_contains($contentType, 'xml')) {
|
||||||
$serverRequest->withParsedBody(Xml::toArray($request->post));
|
$serverRequest->withParsedBody(Xml::toArray($request->getContent()));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$serverRequest->withParsedBody($request->post ?? []);
|
$serverRequest->withParsedBody($request->post ?? []);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user