def __read_headers( self ):
        self.response_code = 400
        self.response_message = "Bad request"

        #first line is response code
        line = self.__request_stream.read_request()
        if not line:
            return

        match = re.match( '^(\S+) (\d+) (.*)$', line.strip() )
        if not match:
            return

        if match.group(1).startswith( 'HTTP' ):
            self.response_code = int( match.group(2) )
            self.response_message = match.group(3)
            self.__headers = []
            while not self.__request_stream.at_end():
                line = self.__request_stream.read_request()
                if line == None:
                    break
                else:
                    cur_line = line.strip()
                    if len( cur_line ) == 0:
                        break
                    else:
                        self.__headers.append( cur_line )
reads HTTP headers from the request stream, leaving the stream at the first line of data
dataset/ETHPy150Open scalyr/scalyr-agent-2/scalyr_agent/builtin_monitors/docker_monitor.py/DockerRequest.__read_headers