async def _read(self, reader):
        """
        Parses HTTP request into member variables
        """
        start_line = await self._readline(reader)
        self.method, self.location, self.version = start_line.decode().split()
        path_query = urllib.parse.unquote(self.location).split('?', 1)
        self.path = path_query[0]
        self.query = {}
        if len(path_query) > 1:
            for q in path_query[1].split('&'):
                try:
                    k, v = q.split('=', 1)
                    self.query[k] = v
                except ValueError:
                    self.query[q] = None
        self.headers = {}
        while True:
            header_raw = await self._readline(reader)
            if header_raw.strip() == b'':
                break
            header = header_raw.decode().split(':', 1)
            self.headers[header[0]] = header[1].strip()

        # TODO implement chunked handling
        self.data = b''
        await self._buffer_body(reader)
async def _read ( self , reader ) : start_line = await self . _readline ( reader ) self . method , self . location , self . version = start_line . decode ( ) . split ( ) path_query = urllib . parse . unquote ( self . location ) . split ( '?' , 1 ) self . path = path_query [ 0 ] self . query = { } if len ( path_query ) > 1 : for q in path_query [ 1 ] . split ( '&' ) : try : k , v = q . split ( '=' , 1 ) self . query [ k ] = v except ValueError : self . query [ q ] = None self . headers = { } while True : header_raw = await self . _readline ( reader ) if header_raw . strip ( ) == b'' : break header = header_raw . decode ( ) . split ( ':' , 1 ) self . headers [ header [ 0 ] ] = header [ 1 ] . strip ( ) self . data = b'' await self . _buffer_body ( reader )
Parses HTTP request into member variables