Esempio n. 1
0
 def first_line(self):
     if not self._proxy and self.method != self.CONNECT:
         url = urlunparse(('', '', self.path or '/', self.params,
                           self.query, self.fragment))
     else:
         url = self.full_url
     return '%s %s %s' % (self.method, url, self.version)
Esempio n. 2
0
 def _buildurl(self):
     pre = ''
     if self._user:
         if not self._password:
             raise ImproperlyConfigured('user but not password')
         pre = '%s:%s@' % (self._user, self._password)
     elif self._password:
         raise ImproperlyConfigured('password but not user')
         assert self._password
     host = self._host
     if isinstance(host, tuple):
         host = '%s:%s' % host
     host = '%s%s' % (pre, host)
     path = '/%s' % self._database if self._database else ''
     query = urlencode(self._urlparams)
     return urlunparse((self._name, host, path, '', query, ''))
Esempio n. 3
0
 def _buildurl(self, **kw):
     pre = ''
     if self._user:
         if self._password:
             pre = '%s:%s@' % (self._user, self._password)
         else:
             pre = '%s@' % self._user
     elif self._password:
         raise ImproperlyConfigured('password but not user')
         assert self._password
     host = self._host
     if isinstance(host, tuple):
         host = '%s:%s' % host
     host = '%s%s' % (pre, host)
     path = '/%s' % self._database if self._database else ''
     kw.update(self._urlparams)
     query = urlencode(kw)
     scheme = self._name
     if self._scheme:
         scheme = '%s+%s' % (self._scheme, scheme)
     return urlunparse((scheme, host, path, '', query, ''))
Esempio n. 4
0
 def _buildurl(self, **kw):
     pre = ''
     if self._user:
         if self._password:
             pre = '%s:%s@' % (self._user, self._password)
         else:
             pre = '%s@' % self._user
     elif self._password:
         raise ImproperlyConfigured('password but not user')
         assert self._password
     host = self._host
     if isinstance(host, tuple):
         host = '%s:%s' % host
     host = '%s%s' % (pre, host)
     path = '/%s' % self._database if self._database else ''
     kw.update(self._urlparams)
     query = urlencode(kw)
     scheme = self._name
     if self._scheme:
         scheme = '%s+%s' % (self._scheme, scheme)
     return urlunparse((scheme, host, path, '', query, ''))
Esempio n. 5
0
 def full_url(self):
     '''Full url of endpoint'''
     return urlunparse((self._scheme, self._netloc, self.path,
                        self.params, self.query, self.fragment))
Esempio n. 6
0
 def _get_full_url(self):
     return urlunparse((self._scheme, self._netloc, self.path,
                        self.params, self.query, self.fragment))
Esempio n. 7
0
 def first_line(self):
     url = self.full_url
     if not self._proxy:
         url = urlunparse(('', '', self.path or '/', self.params,
                           self.query, self.fragment))
     return '%s %s %s' % (self.method, url, self.version)
Esempio n. 8
0
 def _get_full_url(self):
     return urlunparse((self._scheme, self._netloc, self.path,
                        self.params, self.query, self.fragment))