Response

The Response class is perfect for dictating how the response from your application is done.

Setting Status Code

For many reasons, you want to set the status code of your response. You can do it with the setStatusCode method.

namespace Application\Controllers;
use Application\Controllers\Controller;
use MightyCore\Http\Response;
class FooController extends Controller
{
public function bar(Response $response){
// Here $response will be initialized and ready to be accessed.
$response->setStatusCode(403);
$response->send("Forbidden");
}
}