Dingo\Api\Http\Response::statusCode PHP Method

statusCode() public method

Set the response status code.
public statusCode ( integer $statusCode ) : Response
$statusCode integer
return Response
    public function statusCode($statusCode)
    {
        return $this->setStatusCode($statusCode);
    }

Usage Example

コード例 #1
0
 public function testBuildingWithCustomStatusCodeAndHeaders()
 {
     $response = new Response('test');
     $response->statusCode(302);
     $response->header('Foo', 'Bar');
     $this->assertEquals('Bar', $response->headers->get('Foo'));
     $this->assertEquals(302, $response->getStatusCode());
 }