Lines Matching refs:headers

30     public $header_regexp; // if set this RE must match against the headers, else abort
31 public $headers;
76 $this->headers = array();
81 if(extension_loaded('zlib')) $this->headers['Accept-encoding'] = 'gzip';
82 $this->headers['Accept'] = 'text/xml,application/xml,application/xhtml+xml,'.
84 $this->headers['Accept-Language'] = 'en-us';
151 * builds the request headers, follows redirects and parses the response.
177 isset($this->headers['Accept-encoding']) &&
178 $this->headers['Accept-encoding'] == 'gzip'){
179 unset($this->headers['Accept-encoding']);
213 // prepare headers
214 $headers = $this->headers;
215 $headers['Host'] = $uri['host']
217 $headers['User-Agent'] = $this->agent;
218 $headers['Referer'] = $this->referer;
222 if (empty($headers['Content-Type'])) {
223 $headers['Content-Type'] = null;
225 switch ($headers['Content-Type']) {
227 $headers['Content-Type'] = 'multipart/form-data; boundary=' . $this->boundary;
231 $headers['Content-Type'] = 'application/x-www-form-urlencoded';
241 $headers['Content-Length'] = $contentlength;
245 $headers['Authorization'] = 'Basic '.base64_encode($this->user.':'.$this->pass);
248 $headers['Proxy-Authorization'] = 'Basic '.base64_encode($this->proxy_user.':'.$this->proxy_pass);
275 if(isset($headers['Proxy-Authentication'])) unset($headers['Proxy-Authentication']);
296 $headers['Connection'] = 'Keep-Alive';
298 $headers['Connection'] = 'Close';
307 $request .= $this->buildHeaders($headers);
315 // read headers from socket
318 $r_line = $this->readLine($socket, 'headers');
322 $this->debug('response headers',$r_headers);
340 // handle headers and cookies
357 $this->debug('Object headers',$this->resp_headers);
393 // check if headers are as expected
395 throw new HTTPClientException('The received headers did not match the given regexp');
535 // read headers from socket
538 $r_line = $this->readLine($socket, 'headers');
770 $headers = array();
779 if(isset($headers[$key])){
780 if(is_array($headers[$key])){
781 $headers[$key][] = $val;
783 $headers[$key] = array($headers[$key],$val);
786 $headers[$key] = $val;
789 return $headers;
797 * @param array $headers
800 protected function buildHeaders($headers){
802 foreach($headers as $key => $value){
817 $headers = '';
819 $headers .= "$key=$val; ";
821 $headers = substr($headers, 0, -2);
822 if ($headers) $headers = "Cookie: $headers".HTTP_NL;
823 return $headers;
854 $out .= HTTP_NL; // end of headers
862 $out .= HTTP_NL; // end of headers