def _get_headers(headers, k):
    """
    Private function for abstracting differences in getting HTTP request
    headers on Python 2 vs. Python 3
    """
    if hasattr(headers, 'get_all'):
        return headers.get_all(k)
    else:
        return headers.getheaders(k)
