コード例 #1
0
 public function testBuildingWithCustomStatusCodeAndHeaders()
 {
     $builder = new ResponseBuilder('test');
     $builder->statusCode(302);
     $builder->header('Foo', 'Bar');
     $response = $builder->build();
     $this->assertEquals('Bar', $response->headers->get('Foo'));
     $this->assertEquals(302, $response->getStatusCode());
 }
コード例 #2
0
ファイル: ResponseFactory.php プロジェクト: jacobDaeHyung/api
 /**
  * Respond with a no content response.
  *
  * @return \Dingo\Api\Http\ResponseBuilder
  */
 public function noContent()
 {
     $response = new ResponseBuilder(null);
     $response->setStatusCode(204);
     return $response;
 }