def _send_unsigned()

in CWMetricsToOpenSearch/es_sink/es_transport.py [0:0]


def _send_unsigned(method, url, body=None, http_auth=None):
    ''' Internal method to pass the request through. '''
    body = valid_request_body(body)
    func = _get_requests_function(method)
    if http_auth:
        (result, took_time) = \
            wall_time(func, url, data=body,
                      headers={"Content-Type":"application/json"},
                      auth=http_auth,
                      verify=False)
        return TransportResult(status=int(result.status_code),
                               result_text=result.text, took_s=took_time,
                               size=len(body))
    (result, took_time) = \
        wall_time(func, url, data=body,
                  headers={"Content-Type":"application/json"},
                  verify=False)
    return TransportResult(status=int(result.status_code),
                           result_text=result.text, took_s=took_time,
                           size=len(body))