Send a request to ITRP and wrap the HTTP Response in an Itrp::Response
 Guaranteed to return a Response, thought it may be +empty?+
353654
def _send(request, domain = @domain, port = @port, ssl = @ssl)
      @logger.debug { "Sending #{request.method} request to #{domain}:#{port}#{request.path}" }
      _response = begin
        http_with_proxy = option(:proxy_host).blank? ? Net::HTTP : Net::HTTP::Proxy(option(:proxy_host), option(:proxy_port), option(:proxy_user), option(:proxy_password))
        http = http_with_proxy.new(domain, port)
        http.read_timeout = option(:read_timeout)
        http.use_ssl = ssl
        http.verify_mode = OpenSSL::SSL::VERIFY_NONE if @ssl_verify_none
        http.start{ |_http| _http.request(request) }
      rescue ::Exception => e
        Struct.new(:body, :message, :code, :header).new(nil, "No Response from Server - #{e.message} for '#{domain}:#{port}#{request.path}'", 500, {})
      end
      response = Itrp::Response.new(request, _response)
      if response.valid?
        @logger.debug { "Response:\n#{JSON.pretty_generate(response.json)}" }
      elsif response.raw.body =~ /^\s*<\?xml/i
        @logger.debug { "XML response:\n#{response.raw.body}" }
      elsif '303' == response.raw.code.to_s
        @logger.debug { "Redirect: #{response.raw.header['Location']}" }
      else
        @logger.error { "Request failed: #{response.message}" }
      end
      response
    end
248008
def response
      request_headers = headers.merge(params: params)

      RestClient::Request.execute(
        method: :get,
        url: url,
        timeout: OpenComponents.config.timeout,
        headers: request_headers
      )
    rescue RestClient::ResourceNotFound => e
      fail ComponentNotFound, e.message
    rescue RestClient::RequestTimeout => e
      fail RegistryTimeout, e.message
    end
403808
def treat_response
        # note that the partial_content status should be processed differently.
        # look at http://tinkerpop.apache.org/docs/3.0.1-incubating/ for more info
        ok_status = [:success, :no_content, :partial_content].map { |st| STATUS[st] }
        unless ok_status.include?(@response['status']['code'])
          fail ::GremlinClient::ServerError.new(@response['status']['code'], @response['status']['message'])
        end
        @response['result']
      end
880170
def _iter_response(self, url, params=None):
        """"""
        if params is None:
            params = {}
        params['page_number'] = 1

        # Last page lists itself as next page
        while True:
            response = self._request(url, params)

            for item in response['result_data']:
                yield item

            # Last page lists itself as next page
            if response['service_meta']['next_page_number'] == params['page_number']:
                break

            params['page_number'] += 1
1013575
async def send(self, request: Request[HTTPRequestType], **config: Any) -> Response[HTTPRequestType, AsyncHTTPResponseType]:
        
        pass
591361
def post(path: nil, payload: nil, headers: {}, query: {})
      execute(method: :post, path: path, headers: headers, query: query, payload: payload)
    end
787720
def fget(url, **options)
      uri = _assert_uri(url)
      Responses::ResponsePromise.new { get(uri, options) }
    end
511157
def post(path, options={}, raw=false, unformatted=true)
      request(:post, path, options, raw, unformatted)
    end
150849
def _send_request(self):
        
        
        # Generate the hash variable and parameters
        self._generate_hash()
        params = self._get_params()
        
        # Make the SOAP request
        try:
            resp = self._endpoint(**params)
            logger.debug(resp)
        except WebFault, e:
            logger.exception('An error occurred while making the SOAP request.')
            return None
        
        # Convert XML response into a dictionary
        self.response = XmlDictConfig(ElementTree.XML(smart_str(resp)))
        
        # Normalize dictionary values
        self.response = normalize_dictionary_values(self.response)
        
        # Log all non OK status codes
        if self.response['status']['errorCode'] != 'OK':
            logger.error(resp)
        
        return self.response
690323
function RequestWrapper(req) {
  this.request = req;
  this.method = req.method;
  this.url = req.url;
  this.body = req._data;
  this.headers = req._header;
}
1070496
def give_response(response, deferred)
      @delayer.new do
        next if deferred.spoiled?
        deferred.exit_await
        fiber.resume(response).accept_request(worker: self,
                                              deferred: deferred)
      end
      nil
    end
1305906
async def send(self, request: Request, **config: Any) -> Response:
        
        return Response(
            request,
            await self.driver.send(request.http_request)
        )
854495
def request(http_method, path, params)
      response = connection.send(http_method, path, params)
      response.body
    end
182531
def core__send_request_fail(error, payload: nil)
      response = { result: false, error_message: error }
      response[:payload] = payload if payload
      render json: response
    end
766839
def _req(self, endpoint, get_data=dict(), post_data=dict()):

        

        if get_data:
            request_parameter = "{}?{}".format(endpoint, urlencode(get_data))
        else:
            request_parameter = endpoint

        try:
            encdata = urlencode(post_data, True).encode('utf-8')
            response = self.oauth.request(request_parameter, data=encdata)
            self._checkResponseForErrors(response)
        except HTTPError as e:
            raise DeviantartError(e)

        return response
1000727
async def send_message(  # type: ignore
        self, request: str, response_expected: bool, **kwargs: Any
    ) -> Response:
        
        headers = dict(self.DEFAULT_HEADERS)
        headers.update(kwargs.pop("headers", {}))

        response = await self.client.fetch(
            self.endpoint, method="POST", body=request, headers=headers, **kwargs
        )

        return Response(response.body.decode(), raw=response)
283167
def send(self):
        
        scheme, location, path, query, _ = urlparse.urlsplit(self.url)
        assert scheme in ("http", "https"), "Unsupported scheme %r" % scheme

        content_type, body = self._encode_multipart_formdata()
        handle = getattr(httplib, scheme.upper() + "Connection")(location)
        if self.mock_http:
            # Don't actually send anything, print to stdout instead
            handle.sock = parts.Bunch(
                sendall=lambda x: sys.stdout.write(fmt.to_utf8(
                    ''.join((c if 32 <= ord(c) < 127 or ord(c) in (8, 10) else u'\u27ea%02X\u27eb' % ord(c)) for c in x)
                )),
                makefile=lambda dummy, _: StringIO.StringIO("\r\n".join((
                    "HTTP/1.0 204 NO CONTENT",
                    "Content-Length: 0",
                    "",
                ))),
                close=lambda: None,
            )

        handle.putrequest('POST', urlparse.urlunsplit(('', '', path, query, '')))
        handle.putheader('Content-Type', content_type)
        handle.putheader('Content-Length', str(len(body)))
        for key, val in self.headers.items():
            handle.putheader(key, val)
        handle.endheaders()
        handle.send(body)
        #print handle.__dict__

        return handle.getresponse()