Sets the acceptable HTTP method to PATCH
190643
def patch(self, urls=None, **overrides):
        """"""
        if urls is not None:
            overrides['urls'] = urls
        return self.where(accept='PATCH', **overrides)
856519
def UploadSeparatePatches(issue, rpc_server, patchset, data, options):
	
	patches = SplitPatch(data)
	rv = []
	for patch in patches:
		set_status("uploading patch for " + patch[0])
		if len(patch[1]) > MAX_UPLOAD_SIZE:
			print ("Not uploading the patch for " + patch[0] +
				" because the file is too large.")
			continue
		form_fields = [("filename", patch[0])]
		if not options.download_base:
			form_fields.append(("content_upload", "1"))
		files = [("data", "data.diff", patch[1])]
		ctype, body = EncodeMultipartFormData(form_fields, files)
		url = "/%d/upload_patch/%d" % (int(issue), int(patchset))
		print "Uploading patch for " + patch[0]
		response_body = rpc_server.Send(url, body, content_type=ctype)
		lines = response_body.splitlines()
		if not lines or lines[0] != "OK":
			StatusUpdate("  --> %s" % response_body)
			sys.exit(1)
		rv.append([lines[1], patch[0]])
	return rv
1000418
private boolean httpMethodSupportsBody(HttpMethod method) {
        return HttpMethod.POST.equals(method) || HttpMethod.PUT.equals(method)
                || HttpMethod.DELETE.equals(method) || HttpMethod.PATCH.equals(method);
    }
623876
def _kpatch(url, data):
    '''  '''

    # Prepare headers
    headers = {"Content-Type": "application/json-patch+json"}
    # Make request
    ret = http.query(url, method='PATCH', header_dict=headers,
                     data=salt.utils.json.dumps(data))
    # Check requests status
    if ret.get('error'):
        log.error("Got an error: %s", ret.get("error"))
        return ret
    else:
        return salt.utils.json.loads(ret.get('body'))
121301
def put(path, data = {}, header = {})
      _send(json_request(Net::HTTP::Patch, path, data, header))
    end
112190
def patch(self, endpoint, json=None, params=None, **kwargs):
        
        json = kwargs['data'] if 'data' in kwargs else json
        return self._make_request('patch', endpoint, data=json, params=params)
706992
public void applyPatch(File file, File currentFolder) throws Exception {
        FileInputStream fis = new FileInputStream(file);
        BufferedReader br = new BufferedReader(new InputStreamReader(fis));
        String line;
        String failedString = patchString;
        String[] patch = patchData;
        // Attempt to look if file is vulnerable
        for (int i = 0 ; i < 80 ; i++) { // Check first 80 lines - if there is no signature it is not our file
            line = br.readLine();
            if (line == null) {
                // File less than 80 lines long, no signature encountered
                return;
            }
            if (line.trim().equals("function validURL(url) {")) { // Already patched
                failedString = null;
                patch = null;
                continue;
            }
            if (line.trim().equals(quickFixString)) { // The patch had famous 2-letter bug, update it
                failedString = quickFixString;
                patch = quickFix;
                continue;
            }
            if (line.trim().equals("function loadFrames() {")) {
                fis.close(); // It should not interfere with the file renaming process
                if (failedString != null) {
                    // Vulnerable file
                    if (!doPatch) { // Report and return
                        System.out.println("Vulnerable file found: "+file.getCanonicalPath());
                    } else {
                        replaceStringInFile(currentFolder, file, failedString, patch);
                    }
                }
                return;
            }
        }
    }
804993
def http_method(self, data):
        """"""
        data = data.upper()
        if data in ['DELETE', 'GET', 'POST', 'PUT']:
            self._http_method = data

            # set content type for commit methods (best guess)
            if self._headers.get('Content-Type') is None and data in ['POST', 'PUT']:
                self.add_header('Content-Type', 'application/json')
        else:
            raise AttributeError(
                'Request Object Error: {} is not a valid HTTP method.'.format(data)
            )
339238
function validMethod(req, res, next) {
    if (httpMethods.indexOf(req.method) === -1) {
        res.sendStatus(405);
    } else {
        next();
    }
}
163373
public static void patch(HttpConsumer<HttpExchange> endpoint, MediaTypes... mediaTypes) {
        addResource(Methods.PATCH, HandlerUtil.BASE_PATH, endpoint, mediaTypes);
    }
1234017
function method (request) {

    if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {
        request.headers.set('X-HTTP-Method-Override', request.method);
        request.method = 'POST';
    }

}
1049454
protected function addHtaccessPatch() {
    $this->taskFilesystemStack()
      ->copy($this->bltRoot . "/scripts/simplesamlphp/htaccess-saml.patch",
        $this->repoRoot . "/patches/htaccess-saml.patch")
      ->run();
    $composer_json = json_decode(file_get_contents($this->getConfigValue('repo.root') . '/composer.json'));
    $composer_json->scripts->{"post-drupal-scaffold-cmd"}[] = "cd docroot && patch -p1 <../patches/htaccess-saml.patch";
    file_put_contents($this->getConfigValue('repo.root') . '/composer.json',
      json_encode($composer_json, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
    $this->taskExecStack()
      ->dir($this->getConfigValue('repo.roou'))
      ->exec("composer post-drupal-scaffold-cmd")
      ->run();
    // @todo throw exceptions.
  }
435776
function _execute(httpMethod, urlSuffix, options, errorMessage) {
        const opts = {
            headers: {
                'Content-Type': 'application/json',
                'ngapimockid': ngapimockid
            }
        };

        if (options !== undefined) {
            opts.json = options;
        }

        return _handleRequest(httpMethod, urlSuffix, opts, errorMessage);
    }
1251871
def apply(cls, fs):
        
        logger.debug(
            'Patching %s with %s.', fs.__class__.__name__, cls.__name__)
        fs._patch = cls
        for method_name in cls.patch_methods:
            # if fs hasn't method, raise AttributeError.
            origin = getattr(fs, method_name)
            method = getattr(cls, method_name)
            bound_method = method.__get__(fs, fs.__class__)
            setattr(fs, method_name, bound_method)
            setattr(fs, '_origin_' + method_name, origin)
1126504
def patch(self):
        """"""
        original = self.__dict__['__original__']
        return jsonpatch.make_patch(original, dict(self)).to_string()
458203
public HttpRequest buildPatchRequest(GenericUrl url, HttpContent content) throws IOException {
    return buildRequest(HttpMethods.PATCH, url, content);
  }
323192
def _patch(self, opt={}):
        
        opt_netloc = opt.pop(Request.opt_url_netloc, None)
        opt_scheme = opt.pop(Request.opt_url_scheme, None)
        if opt_netloc or opt_scheme:
            scheme, netloc, path, params, query, fragment = six.moves.urllib.parse.urlparse(self.__url)
            self.__url = six.moves.urllib.parse.urlunparse((
                opt_scheme or scheme,
                opt_netloc or netloc,
                path,
                params,
                query,
                fragment
            ))

            logger.info('patching url: [{0}]'.format(self.__url))