Esempio n. 1
0
def parse_nuxeo_request(request_content):
    lines = request_content.split(b'\r\n')
    method, path, _ = get_text(lines.pop(0)).split(' ')
    path = path.split('/')[4:]
    headers = {}
    for line in lines:
        if not line:
            break
        h = get_text(line).split(': ')
        headers[h[0]] = h[1]
    return method, path, headers
Esempio n. 2
0
 def fetch(self, ref: str, **kwargs: Any) -> Dict[str, Any]:
     try:
         return self.operations.execute(command="Document.Fetch",
                                        value=get_text(ref),
                                        **kwargs)
     except HTTPError as e:
         if e.status == 404:
             raise NotFound("Failed to fetch document %r on server %r" %
                            (ref, self.client.host))
         raise e
Esempio n. 3
0
 def fetch(self, ref: str, **kwargs: Any) -> Dict[str, Any]:
     return self.execute(command="Document.Fetch",
                         value=get_text(ref),
                         **kwargs)
Esempio n. 4
0
 def fetch(self, ref: str, **kwargs: Any) -> Dict[str, Any]:
     return self.execute(command="Document.Fetch", value=get_text(ref), **kwargs)