This commit is contained in:
as2252258@163.com
2021-09-21 01:10:16 +08:00
parent 1ba07aeb5f
commit 1bd3936db0
+1 -2
View File
@@ -21,7 +21,6 @@ abstract class Handler implements RequestHandlerInterface
private int $offset = 0;
protected AspectProxy $aspectProxy;
@@ -103,7 +102,7 @@ abstract class Handler implements RequestHandlerInterface
if (is_object($responseData)) {
$responseData = get_object_vars($responseData);
}
if ($interface->getContentType() == 'application/xml;charset=utf-8') {
if (str_contains($interface->getContentType(), 'xml')) {
$interface->getBody()->write(Help::toXml($responseData));
} else if (is_array($responseData)) {
$interface->getBody()->write(json_encode($responseData));