Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
withJson should not set http status code implicitly #1737
Please also note that
@AndrewCarterUK that should return a response with 200, if the developer wants it to return a status of 404 either do:
$response = $response->withStatusCode(404) ->withHeader('Content-Type', 'application/json;charset=utf-8') ->getBody()->write(json_encode());
It 'does' return that status code, I wouldn't say that it should.
Also, by default the status code would be 200, so it's a truly pointless feature if that was the intent. All it could do is overwrite an implicit change.