示例#1
0
 def bind(self, r):
   """Bind the Request to another one. This method will copy the supplied
   request's cookies and response set-cookies to the Request."""
   r_new = self.copy()
   for c in r.get_header('Cookie'):
     r_new.add_header('Cookie', c)
   if r.response:
     cookies = []
     for c in r.response.get_header('Set-Cookie'):
       cookies.append(Cookie.parse(c, set_cookie=True))
     r_new.add_header('Cookie', "; ".join([str(x) for x in cookies]))
   return r_new
示例#2
0
 def bind(self, r):
     """Bind the Request to another one. This method will copy the supplied
 request's cookies and response set-cookies to the Request."""
     r_new = self.copy()
     for c in r.get_header('Cookie'):
         r_new.add_header('Cookie', c)
     if r.response:
         cookies = []
         for c in r.response.get_header('Set-Cookie'):
             cookies.append(Cookie.parse(c, set_cookie=True))
         r_new.add_header('Cookie', "; ".join([str(x) for x in cookies]))
     return r_new
示例#3
0
 def cookies(self):
   cookies = []
   for h in self.get_header("Cookie"):
     cookies.extend(Cookie.parse(h))
   return cookies
示例#4
0
 def cookies(self):
   cookies = []
   for h in self.get_header("Set-Cookie"):
     cookies.append(Cookie.parse(h, set_cookie=True))
   return cookies
示例#5
0
 def cookies(self):
     cookies = []
     for h in self.get_header("Set-Cookie"):
         cookies.append(Cookie.parse(h, set_cookie=True))
     return cookies
示例#6
0
 def cookies(self):
     cookies = []
     for h in self.get_header("Cookie"):
         cookies.extend(Cookie.parse(h))
     return cookies