def METHOD_NAME(data, exclude=None):
    pyramid_request.content_type = pyramid_request.headers[
        "content-type"
    ] = "application/json"
    if exclude:
        for field in exclude:
            data.pop(field, None)
    pyramid_request.body = json.dumps(data)
    return pyramid_request