Request a URL using the HTTP method PATCH.
430883
def patchURL(self, url, headers, body):
        
        return self._load_resource("PATCH", url, headers, body)
671135
def request method, path, opts={}
      conn_options = connection_options opts
      opts['api_key'] = api_key unless opts.has_key? 'api_key'
      opts['file_type'] = file_type unless opts.has_key? 'file_type'

      response = connection(conn_options).send(method) do |request|
        case method
        when :get
          request.url path, opts
        when :delete
          request.url path, opts
        when :patch, :post, :put
          if conn_options[:force_urlencoded]
            request.url path, opts
          else
            request.path = path
            request.body = MultiJson.dump(opts) unless opts.empty?
          end
        end
      end

      response
    end
331533
def patch(path, options = {}, &block)
      perform_request Net::HTTP::Patch, path, options, &block
    end
1153911
def patched(f):
    """"""

    def wrapped(*args, **kwargs):

        kwargs['return_response'] = False
        kwargs['prefetch'] = True

        return f(*args, **kwargs)

    return wrapped
608824
def patch(self, path, data, **options):
        
        data, options = self._update_request(data, options)
        return self.request('patch', path, data=data, **options)
987817
def querystring_update(request, **kwargs):
    
    updated = request.GET.copy()
    for k, v in kwargs.items():
        updated[k] = v

    return updated.urlencode()
981912
def patch_io_httplib(config):
    

    # pylint: disable=import-error

    def start(method, url):
        job = get_current_job()
        if job:
            job.set_current_io({
                "type": "http.%s" % method.lower(),
                "data": {
                    "url": url
                }
            })

    def stop():
        job = get_current_job()
        if job:
            job.set_current_io(None)

    class mrq_wrapped_socket(object):
        """ Socket-like object that keeps track of 'trace_args' and wraps our monitoring code
            around blocking I/O calls. """

        def __init__(self, obj, parent_connection):
            self._obj = obj
            self._parent_connection = parent_connection

            def _make_patched_method(method):
                def _patched_method(*args, **kwargs):

                    # In the case of HTTPS, we may connect() before having called conn.request()
                    # For requests/urllib3, we may need to plug ourselves at the
                    # connectionpool.urlopen level
                    if not hasattr(self._parent_connection, "_traced_args"):
                        return getattr(self._obj, method)(*args, **kwargs)

                    start(*self._parent_connection._traced_args)  # pylint: disable=protected-access
                    try:
                        data = getattr(self._obj, method)(*args, **kwargs)
                    finally:
                        stop()
                    return data
                return _patched_method

            # Replace socket methods with instrumented ones
            for method in [

              # socket
              "send", "sendall", "sendto", "recv", "recvfrom", "recvfrom_into", "recv_into",
              "connect", "connect_ex", "close",

              # fileobject
              "read", "readline", "write", "writelines", "seek"
            ]:
                setattr(self, method, _make_patched_method(method))

        # Forward all other calls/attributes to the base socket
        def __getattr__(self, attr):
            # cprint(attr, "green")
            return getattr(self._obj, attr)

        def makefile(self, *args, **kwargs):
            newsock = self._obj.makefile(*args, **kwargs)
            return mrq_wrapped_socket(newsock, self._parent_connection)

    def request(old_method, self, method, url, body=None, headers=None, *args, **kwargs):

        if headers is None:
            headers = {}

        # This is for proxy support - TODO show that in dashboard?
        if re.search(r"^http(s?)\:\/\/", url):
            report_url = url
        else:
            protocol = "http"
            if hasattr(self, "key_file"):
                protocol = "https"

            report_url = "%s://%s%s%s" % (
                protocol,
                self.host,
                (":%s" % self.port) if self.port != 80 else "",
                url
            )

        self._traced_args = (method, report_url)  # pylint: disable=protected-access
        res = old_method(self, method, url, body=body, headers=headers)
        return res

    def connect(old_method, self, *args, **kwargs):

        # In the case of HTTPS, we may connect() before having called conn.request()
        # For requests/urllib3, we may need to plug ourselves at the connectionpool.urlopen level
        if not hasattr(self, "_traced_args"):
            ret = old_method(self, *args, **kwargs)
        else:
            start(*self._traced_args)  # pylint: disable=protected-access
            try:
                ret = old_method(self, *args, **kwargs)
            finally:
                stop()
        self.sock = mrq_wrapped_socket(self.sock, self)

        return ret

    from http.client import HTTPConnection, HTTPSConnection

    patch_method(HTTPConnection, "request", request)
    patch_method(HTTPConnection, "connect", connect)
    patch_method(HTTPSConnection, "connect", connect)

    # Try to patch requests & urllib3 as they are very popular python modules.
    try:
        from requests.packages.urllib3.connection import (
            HTTPConnection,
            UnverifiedHTTPSConnection,
            VerifiedHTTPSConnection
        )

        patch_method(HTTPConnection, "connect", connect)
        patch_method(UnverifiedHTTPSConnection, "connect", connect)
        patch_method(VerifiedHTTPSConnection, "connect", connect)

    except ImportError:
        pass

    try:
        from urllib3.connection import (
            HTTPConnection,
            UnverifiedHTTPSConnection,
            VerifiedHTTPSConnection
        )

        patch_method(HTTPConnection, "connect", connect)
        patch_method(UnverifiedHTTPSConnection, "connect", connect)
        patch_method(VerifiedHTTPSConnection, "connect", connect)

    except ImportError:
        pass
472905
public HttpRequest method(Method method) {
		if (Method.PATCH == method) {
			this.method = Method.POST;
			this.header("X-HTTP-Method-Override", "PATCH");
		} else {
			this.method = method;
		}
		return this;
	}
18010
def _http_request(self, method, url, request_kwargs=None):
        

        kwargs = request_kwargs if request_kwargs is not None else {}

        headers = self._request_headers()
        headers.update(self.additional_headers)
        if 'headers' in kwargs:
            headers.update(kwargs['headers'])
        kwargs['headers'] = headers

        if self._has_proxy():
            kwargs['proxies'] = self._proxy_parameters()

        request_url = self._url(
            url,
            file_upload=kwargs.pop('file_upload', False)
        )

        request_method = getattr(requests, method)
        response = request_method(request_url, **kwargs)

        if response.status_code == 429:
            raise RateLimitExceededError(response)

        return response
1215484
def _request(self, path, method, body=None):
        """"""
        url = '/'.join([_SERVER, path])
        (resp, content) = _HTTP.request(url, method,
                                        headers=self._headers, body=body)

        content_type = resp.get('content-type')
        if content_type and content_type.startswith('application/json'):
            content = json.loads(content.decode('UTF-8'))

        return (resp, content)
230540
def get(self, url, **kwargs):
        
        """

        kwargs.setdefault('allow_redirects', True)
        return self.request('GET', url, **kwargs)
966836
def patch(path, data, options = {})
      uri = build_uri(path, options)

      request = Net::HTTP::Patch.new(uri.request_uri)
      set_authorisation_header(request)
      request.set_form_data(data)

      response = https_client(uri).request(request)
    end
438798
public RouteMatcher patch(String pattern, Handler<HttpServerRequest> handler) {
		addPattern(pattern, handler, patchBindings);
		return this;
	}
856833
def _request(method, url, session=None, **kwargs):
    
    url = BASE_URL + url

    if session:
        request_func = getattr(session, method)
    else:
        request_func = getattr(requests, method)
    response = request_func(url, **kwargs)
    # raise an exception if request is not successful
    if not response.status_code == requests.codes.ok:
        raise DweepyError('HTTP {0} response'.format(response.status_code))
    response_json = response.json()
    if response_json['this'] == 'failed':
        raise DweepyError(response_json['because'])
    return response_json['with']
352533
def patch(self, path=None, method='PATCH', **options):
        
        return self.route(path, method, **options)
981352
def request(self, method, url, **kwargs):
        """"""
        if not url.startswith('https'):
            url = '{}{}'.format(self.args.tc_api_path, url)
        return super(TcExSession, self).request(method, url, **kwargs)
159657
function request(method, params, callback) {

  var headers = {
    Accept: 'application/vnd.layer+json; version=' + this.version,
    Authorization: 'Bearer ' + this.token
  };

  if (method === 'patch') headers['Content-Type'] = 'application/vnd.layer-patch+json';
  else headers['Content-Type'] = 'application/json';

  if (params.dedupe) headers['If-None-Match'] = params.dedupe;

  var options = {
    host: API.host,
    port: API.port,
    path: API.prefix + this.appId + params.path,
    method: method.toUpperCase(),
    headers: headers
  }

  if (this.agent) options.agent = this.agent;

  var req = https.request(options);

  req.setTimeout(this.timeout, timeout.bind(this, req, callback));
  req.on('error', error.bind(this, req, callback));
  req.on('response', response.bind(this, callback));

  req.on('socket', function(socket) {
    var write = function() {
      if (params.body) req.write(JSON.stringify(params.body));
      req.end();
    }
    // reusing connection when using keepAlive agent
    if (socket.authorized) write();
    else socket.on('secureConnect', function() { write(); })
  });
}