code: def request(method='GET'):
      
  
      def decorator(func):
          @functools.wraps(func)
          def action(self, *args, **kwargs):
              f = furl(self.server)
              path, body = func(self, *args, **kwargs)
  
              # deal with query string
              query = dict()
              if isinstance(path, tuple):
                  path, query = path
              f.path.add(path)
              f.query.set(query)
  
              status_code, result = send_rest(f.url, method=method.upper(),
                                              body=body,
                                              session=self.session,
                                              headers=self.headers)
              if status_code != httplib.OK:
                  self.logger.error("{impl} {url} headers: {headers}, code: {code}".format(
                      impl=method, url=f.url, headers=self.headers, code=status_code))
              return status_code, result
  
          return action
  
      return decorator
docs: send restful post http request decorator
  
      Provide a brief way to manipulate restful api,
  
      :param method: :class:`str`,
  
      :return: :class:`func`