Example #1
0
def call(
    client: http.Client,
    headers: Headers,
) -> Response:

    url = URL

    resp = client.make_call(
        method=METHOD,
        url=url,
        headers=http.only_provided_values(dump_headers(headers).items()),
        is_stream=IS_STREAMING_RESPONSE,
    )

    return parse_response(resp.json())
Example #2
0
def call(
    client: http.Client,
    request: Request,
    params: Params,
    headers: Headers,
) -> Response:

    url = URL.format(**dump_params(params))

    resp = client.make_call(
        method=METHOD,
        url=url,
        headers=http.only_provided_values(dump_headers(headers).items()),
        payload=dump_request(request),
        is_stream=IS_STREAMING_RESPONSE,
    )

    return parse_response(resp.json())