def _parse_header_lines(self, header_lines):

        # Parse the lines before the body.
        # Build request headers list.

        headers = []

        for header in header_lines:
            header = header.lstrip()

            # Skip comments and overrides.
            if header[0] in ("#", "@"):
                pass

            # Query parameters begin with ? or &
            elif header[0] in ("?", "&"):

                if "=" in header:
                    (key, value) = header[1:].split("=", 1)
                elif ":" in header:
                    (key, value) = header[1:].split(":", 1)
                else:
                    key, value = None, None

                if key and value:
                    key = key.strip()
                    value = quote(value.strip())
                    if key in self.request.query:
                        self.request.query[key].append(value)
                    else:
                        self.request.query[key] = [value]

            # All else are headers
            elif ":" in header:
                (key, value) = header.split(":", 1)
                headers.append((key, value.strip()))

        # Merge headers with default headers provided in settings.
        self.request.headers.extend(headers)
dataset/ETHPy150Open pjdietz/rester-sublime-http-client/rester/parse.py/RequestParser._parse_header_lines/original