示例#1
0
文件: CookieJar.php 项目: weew/http
 /**
  * @param array $cookies
  */
 protected function buildCookies(array $cookies)
 {
     $header = '';
     foreach ($cookies as $key => $value) {
         $header .= $this->formatCookie($key, $value) . ' ';
     }
     $this->holder->getHeaders()->set('cookie', $header);
 }
示例#2
0
文件: Cookies.php 项目: weew/http
 /**
  * Parse headers for cookies.
  */
 protected function searchCookiesInHeaders()
 {
     $headers = $this->holder->getHeaders()->get('set-cookie');
     foreach ($headers as $header) {
         $cookie = $this->createCookieFromHeader($header);
         if ($cookie !== null) {
             $this->storeCookie($cookie);
         }
     }
 }
示例#3
0
 /**
  * @return bool
  */
 public function hasBasicAuth()
 {
     return $this->parser->hasBasicAuth($this->holder->getHeaders());
 }