This commit is contained in:
2021-09-10 13:57:27 +08:00
parent 15fc47b4eb
commit 6bbd25d132
+2 -2
View File
@@ -16,10 +16,10 @@ class Parse
public static function data($content, $contentType): mixed public static function data($content, $contentType): mixed
{ {
if (str_contains($contentType, 'json')) { if (str_contains($contentType, 'json')) {
return json_encode($contentType); return json_encode($content);
} }
if (str_contains($contentType, 'xml')) { if (str_contains($contentType, 'xml')) {
return Xml::toArray($contentType); return Xml::toArray($content);
} }
if (str_contains($contentType, 'x-www-form-urlencoded')) { if (str_contains($contentType, 'x-www-form-urlencoded')) {
parse_str($content, $array); parse_str($content, $array);