0
所以我已经做了相当多挖,只能似乎拿出资料SlimFramework 2,没事就3
我的问题与其说是这样的:
return $res->withStatus(401)->withHeader('Content-type','application/json')->write(json_encode(array(
'Error'=>'Your session has timed out.',
'X-SessionToken' => $session_uuid,
'Server date/time' => date('c'),
'Last activity' => Session::sharedInstance()->last_activity(),
'Path' => $path
)));
仍然返回状态为200,Content-type仍然设置为text/html,但我的身体都在那里。有什么想法吗?我尝试通过关于write()的PSR-7文档来查看是否可能在此之后将标题和状态设置为默认值,但没有看到任何内容。