def log_response(r):
    """ Serialize a httpx.Response object into a dict for logging """
    return {
        "status_code" : r.status_code,
        "headers" : dict(r.headers),
        "data" : r.text,
    }