def _get_headers(url, decoders=None, credentials=None):
    """
    Return a dictionary of HTTP headers to use in the outgoing request.
    """
    if decoders is None:
        decoders = default_decoders

    accept = '%s, */*' % decoders[0].media_type

    headers = {
        'accept': accept,
        'user-agent': 'coreapi'
    }

    if credentials:
        # Include any authorization credentials relevant to this domain.
        url_components = urlparse.urlparse(url)
        host = url_components.hostname
        if host in credentials:
            headers['authorization'] = credentials[host]

    return headers
dataset/ETHPy150Open core-api/python-client/coreapi/transports/http.py/_get_headers/original