Used internally to send a request to the API, left public
        so it can be used to talk to the API more directly.
776033
def do_req(self, method, url, body=None, headers=None, status=None):
        
        if body is None:
            body = ''
        else:
            body = json.dumps(body)
        res = self.backend.dispatch_request(method=method,
                                            url=url,
                                            body=body,
                                            headers=self.get_headers(headers),
                                            auth=self.auth)
        if not isinstance(res, MapiResponse):
            res = MapiResponse(*res)
        if status is None:
            if res.status // 100 != 2:
                raise MapiError(*res)
        elif res.status != status:
            raise MapiError(*res)

        return res
117273
def sendRequest( api_Request, xmlRequestData = nil )

      fire( "onSendRequest" )

      resetErrorInfo

      # set up the request
      getDBforRequestURL( api_Request )
      getAuthenticationXMLforRequest( api_Request )
      isHTMLRequest = isHTMLRequest?( api_Request )
      api_Request = "API_" + api_Request.to_s if prependAPI?( api_Request )

      xmlRequestData << toXML( :udata, @udata ) if @udata and @udata.length > 0
      xmlRequestData << toXML( :rdr, @rdr ) if @rdr and @rdr.length > 0
      xmlRequestData << toXML( :xsl, @xsl ) if @xsl and @xsl.length > 0
      xmlRequestData << toXML( :encoding, @encoding ) if @encoding and @encoding.length > 0

      if xmlRequestData
         @requestXML = toXML( :qdbapi, @authenticationXML + xmlRequestData )
      else
         @requestXML = toXML( :qdbapi, @authenticationXML )
      end

      @requestHeaders = @standardRequestHeaders
      @requestHeaders["Content-Length"] = "#{@requestXML.length}"
      @requestHeaders["QUICKBASE-ACTION"] = api_Request
      @requestURL = "#{@qbhost}#{@dbidForRequestURL}"

      printRequest( @requestURL, @requestHeaders,  @requestXML ) if @printRequestsAndResponses
      @logger.logRequest( @dbidForRequestURL, api_Request, @requestXML ) if @logger

      begin

         # send the request
         if USING_HTTPCLIENT
            response = @httpConnection.post( @requestURL, @requestXML, @requestHeaders )
            @responseCode = response.status
            @responseXML = response.content
         else  
            if Net::HTTP.version_1_2?
               response = @httpConnection.post( @requestURL, @requestXML, @requestHeaders )
               @responseCode = response.code
               @responseXML = response.body
            else
               @responseCode, @responseXML = @httpConnection.post( @requestURL, @requestXML, @requestHeaders )
            end	
         end
          
         printResponse( @responseCode,  @responseXML ) if @printRequestsAndResponses

         if not isHTMLRequest
            processResponse( @responseXML )
         end

      @logger.logResponse( @lastError, @responseXML ) if @logger

      fireDBChangeEvents

      rescue Net::HTTPBadResponse => error
         @lastError = "Bad HTTP Response: #{error}"
      rescue Net::HTTPHeaderSyntaxError => error
         @lastError = "Bad HTTP header syntax: #{error}"
      rescue StandardError => error
         @lastError = "Error processing #{api_Request} request: #{error}"
      end

      @requestSucceeded = ( @errcode == "0" and @lastError == "" )

      fire( @requestSucceeded ? "onRequestSucceeded" : "onRequestFailed" )

      if @stopOnError and !@requestSucceeded
         raise @lastError
      end
   end
959643
private void sendRequest(String methodName, Object... params) {
        sendRequest(new InvocationRequest(methodName, params), true);
        
    }
998873
def make_request(method, path, options, raw=false)
      options.merge!({:key => api_key, :id => api_id })

      response = connection(raw).send(method) do |request|
        case method
        when :get, :delete
          request.url(path, options)
        when :post, :put
          request.path = path
          request.body = options unless options.empty?
        end
      end
      return response if raw
      return response.body
    end
804976
private void sendSomeRequests() {
		ResponseListener responseListener = new MyResponseListener();

		sendCustomUrlRequest(responseListener);
		sendAutoRetryRequest(responseListener);
		downloadImage(responseListener);
		uploadData(responseListener);
		uploadFile(responseListener);
		uploadText(responseListener);
	}
479404
def request(self, method, url, *args):
        
        return self.http.request(method, url, *args)
523293
def _request_internal(self, command, **kwargs):
        """"""
        args = dict(kwargs)
        if self.ssid:
            args['ssid'] = self.ssid
        method = getattr(self.api, command)
        response = method(**args)
        if response and 'status' in response:
            if response['status'] == 'error':
                raise SubregError(
                    message=response['error']['errormsg'],
                    major=response['error']['errorcode']['major'],
                    minor=response['error']['errorcode']['minor']
                )
            if response['status'] == 'ok':
                return response['data'] if 'data' in response else dict()
            raise Exception("Invalid status found in SOAP response")
        raise Exception('Invalid response')
647173
def request(self, method, url, **kwargs):
        

        if "data" in kwargs:
            kwargs["data"] = json.dumps(kwargs["data"])

        kwargs["headers"] = {
            'Content-Type': 'application/json',
            'Authorization': 'token %s' % self.__token__,
        }
        req = make_request(
            method,
            url,
            **kwargs
        )
        self.logger.debug(
            "Request::{}::{}".format(method, url),
            extra={
                "request": kwargs,
                "response": {"headers": req.headers, "code": req.status_code, "data": req.content}
            }
        )
        return req
304765
private static String doRequestWithBody(String url, String method, Map<String, String> header, String ctype, byte[] content, int connectTimeout, int readTimeout) throws IOException {
    HttpURLConnection conn = null;
    OutputStream out = null;
    String rsp = null;
    try {
      try {
        conn = getConnection(new URL(url), method, header, ctype);
        conn.setConnectTimeout(connectTimeout);
        conn.setReadTimeout(readTimeout);
      } catch (IOException e) {
        throw e;
      }
      try {
        out = conn.getOutputStream();
        out.write(content);
        rsp = getResponseAsString(conn);
      } catch (IOException e) {
        throw e;
      }

    } finally {
      if (out != null) {
        out.close();
      }
      if (conn != null) {
        conn.disconnect();
      }
    }
    return rsp;
  }
104015
def _make_api_call(self, api_method, **kwargs):
        '''
        '''
        api_url = '/'.join((self.api_base_url, api_method))
        parameters = dict()
        parameters.update(self.default_parameters)
        parameters.update(kwargs)
        post_params = urlencode(parameters).encode('utf-8')
        response = self.opener.open(api_url, post_params)
        return json.loads(response.read().decode('utf-8'))
1187393
def send_request(id, method, params)
      data = MessagePack.dump([0, id, method, params]).bytes
      ws.send(data)
    rescue => exc
      warn exc
      abort exc
    end
1333871
def api_request(*args, **kwargs):
        
        r = requests.request(*args, **kwargs)
        return APIResponse(r)
1140189
def send_request(self, request, callback=None, timeout=None, no_response=False):  # pragma: no cover
        
        if callback is not None:
            thread = threading.Thread(target=self._thread_body, args=(request, callback))
            thread.start()
        else:
            self.protocol.send_message(request)
            if no_response:
                return
            try:
                response = self.queue.get(block=True, timeout=timeout)
            except Empty:
                #if timeout is set
                response = None
            return response
724486
def execute_internal(json_request, &block)

      if json_request.respond_to?(:headers) then
        # always required for posting to API
        json_request.headers["Content-Type"] = "application/json"
      end

      req = HTTPI::Request.new(:url => @uri, :body => json_request.to_wire)

      # add in extra headers if we have a SignedJsonRequest (or anything which has additional headers)
      if json_request.respond_to? :headers then
        req.headers.merge!(json_request.headers)
      end

      if block then
        # execute request with block
        req.on_body(&block)
        HTTPI.post(req)
        return JsonResponse.new("success")

      else
        # execute normal req, and return parsed response
        res = HTTPI.post(req).body
        return JsonResponse.from_json(res)
      end


    end
1227211
<RequestT, ResponseT> ApiFuture<ResponseT> sendRequest(
      RequestT requestT, UnaryCallable<RequestT, ResponseT> callable) {
    Preconditions.checkState(!closed, "Firestore client has already been closed");
    return callable.futureCall(requestT);
  }
716327
def send_request(request)
      message = RemoteMessage.new(request_message: request).serialize_to_string
      message_size = [message.length].pack('N')
      @ssl_client.write(message_size + message)
    end
1205936
function Requests(apiUrl, version, publicKey) {
    this.apiUrl = stripSlashes(apiUrl);
    this.version = version.toString();
    this.publicKey = publicKey;
}