fuel/fuel/core/classes/request/driver.php
public function set_response($body, $status, $mime = null, $headers = array(), $accept_header = null)
	{
		// did we use an accept header? If so, validate the returned mimetype
		if ( ! $this->mime_in_header($mime, $accept_header))
		{
			throw new \OutOfRangeException('The mimetype "'.$mime.'" of the returned response is not acceptable according to the accept header send.');
		}

		// do we have auto formatting enabled and can we format this mime type?
		if ($this->auto_format and array_key_exists($mime, static::$auto_detect_formats))
		{
			$body = \Format::forge($body, static::$auto_detect_formats[$mime])->to_array();
		}

		$this->response = \Response::forge($body, $status, $headers);

		return $this->response;
	}
public function set_response($body, $status, $mime = null, $headers = array(), $accept_header = null)
	{
		// did we use an accept header? If so, validate the returned mimetype
		if ( ! $this->mime_in_header($mime, $accept_header))
		{
			throw new \OutOfRangeException('The mimetype "'.$mime.'" of the returned response is not acceptable according to the accept header send.');
		}

		// do we have auto formatting enabled and can we format this mime type?
		if ($this->auto_format and array_key_exists($mime, static::$auto_detect_formats))
		{
			$body = \Format::forge($body, static::$auto_detect_formats[$mime])->to_array();
		}

		$this->response = \Response::forge($body, $status, $headers);

		return $this->response;
	}
public function set_response ( $ body , $ status , $ mime = null , $ headers = array ( ) , $ accept_header = null ) { // did we use an accept header? If so, validate the returned mimetype if ( ! $ this -> mime_in_header ( $ mime , $ accept_header ) ) { throw new \ OutOfRangeException ( 'The mimetype "' . $ mime . '" of the returned response is not acceptable according to the accept header send.' ) ; } // do we have auto formatting enabled and can we format this mime type? if ( $ this -> auto_format and array_key_exists ( $ mime , static :: $ auto_detect_formats ) ) { $ body = \ Format :: forge ( $ body , static :: $ auto_detect_formats [ $ mime ] ) -> to_array ( ) ; } $ this -> response = \ Response :: forge ( $ body , $ status , $ headers ) ; return $ this -> response ; }
Creates the Response and optionally attempts to auto-format the output

@param   string  $body
@param   int     $status
@param   string  $mime
@param   array   $headers
@param   string  $accept_header
@return  Response

@throws OutOfRangeException if an accept header was specified, but the mime type isn't in it
Creates the Response and optionally attempts to auto - format the output