public function __construct(array $config = array()) { parent::__construct($config); $methods = array_merge(Httpful\Http::safeMethods(), Httpful\Http::idempotentMethods(), Httpful\Http::canHaveBody()); $methods = array_map('strtolower', $methods); $this->_methods = $methods; }
/** * @param string $body * @param string $headers * @param Request $request * @param array $meta_data */ public function __construct($body, $headers, Request $request, array $meta_data = array()) { $this->request = $request; $this->raw_headers = $headers; $this->raw_body = $body; $this->meta_data = $meta_data; $this->code = $this->_parseCode($headers); $this->reason = Http::reason($this->code); $this->headers = Response\Headers::fromString($headers); $this->_interpretHeaders(); $this->body = $this->_parse($body); }