Response class for the rest api
- Author
 - mlunz.nosp@m.ena@.nosp@m.uos.d.nosp@m.e @license GPL 2 or later 
 
- Since
 - Stud.IP 3.0 
 
 
◆ __construct()
      
        
          | __construct  | 
          ( | 
            | 
          $body = '',  | 
        
        
           | 
           | 
            | 
          $status = 200,  | 
        
        
           | 
           | 
            | 
          $headers = []  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Constructor, sets vital information if provided.
- Parameters
 - 
  
    | String | $body | Body contents of the response, optional, defaults to empty string  | 
    | int | $status | HTTP status code, optional, defaults to 200  | 
    | Array | $headers | HTTP headers, optional, defaults to no headers  | 
  
   
 
 
◆ finish()
      
        
          | finish  | 
          ( | 
            | 
          $content_renderer | ) | 
           | 
        
      
 
Finishes the response with the given response renderer.
- Parameters
 - 
  
    | RESTAPI\Renderer\DefaultRenderer | $content_renderer | Used response renderer, only applied if body is not a callable closure  | 
  
   
 
 
◆ isSuccess()
Detects whether the response status is of success type (HTTP status 2xx)
- Returns
 - bool True if status is of success type, false otherwise 
 
 
 
◆ offsetExists()
◆ offsetGet()
◆ offsetSet()
      
        
          | offsetSet  | 
          ( | 
            | 
          $offset,  | 
        
        
           | 
           | 
            | 
          $value  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
 
◆ offsetUnset()
◆ output()
◆ reason()
Returns the reason phrase of this response according to RFC2616.
- Returns
 - string the reason phrase for this response's status 
 
 
 
◆ sendHeader()
      
        
          | sendHeader  | 
          ( | 
            | 
          $header,  | 
        
        
           | 
           | 
            | 
          $replace = FALSE,  | 
        
        
           | 
           | 
            | 
          $status = NULL  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Internally used function to actually send headers
- Parameters
 - 
  
    | string | the HTTP header  | 
    | bool | optional; TRUE if previously sent header should be replaced - FALSE otherwise (default)  | 
    | integer | optional; the HTTP response code | 
  
   
- Returns
 - void 
 
 
 
◆ $body
◆ $headers
◆ $status
The documentation for this class was generated from the following file: