Handles an {@link HttpMethod#PATCH PATCH} request.
This method sends a {@link HttpStatus#METHOD_NOT_ALLOWED 405 Method Not Allowed} response by default.

@deprecated Use {@link #doPatch(ServiceRequestContext, HttpRequest)}.
559898
@Deprecated
    protected void doPatch(ServiceRequestContext ctx, HttpRequest req, HttpResponseWriter res)
            throws Exception {
        res.respond(HttpStatus.METHOD_NOT_ALLOWED);
    }
1059687
private PostMethod getRequestMethod(boolean refresh, String id) throws UnsupportedEncodingException {
		GOCTransport gocTransport = new GOCTransport();
		EndpointInfo endpointInfo = gocTransport.getEndpointInfo(_config, _logger, refresh);

		// Create upsert URI with PATCH method
		PostMethod post = new PostMethod(String.format("%s/services/data/v25.0/sobjects/SM_Alert__c/%s/%s", endpointInfo.getEndPoint(),
				urlEncode(GOCData.SM_ALERT_ID__C_FIELD), urlEncode(id))) {

			@Override
			public String getName() {
				return "PATCH";
			}
		};
		post.setRequestHeader("Authorization", "Bearer " + endpointInfo.getToken());
		return post;
	}
610611
def _rest_patch(self, suburi, request_headers, request_body):
        
        return self._rest_op('PATCH', suburi, request_headers, request_body)
576193
private void handleNewRequest() {

        // if this is an http/2 request, skip to discrimination
        if (!isAlpnHttp2Link(this.vc)) {
            final HttpInboundServiceContextImpl sc = getHTTPContext();
            // save the request info that was parsed in case somebody changes it
            sc.setRequestVersion(sc.getRequest().getVersionValue());
            sc.setRequestMethod(sc.getRequest().getMethodValue());

            // get the response message initialized. Note: in the proxy env, this
            // response message will be overwritten; however, this is the only
            // spot to init() it correctly for all other cases.
            sc.getResponseImpl().init(sc);

            this.numRequestsProcessed++;
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Received request number " + this.numRequestsProcessed + " on link " + this);
            }

            // check for the 100-continue scenario
            if (!sc.check100Continue()) {
                return;
            }
        }
        handleDiscrimination();
    }
862059
private boolean checkActionMethod(AppController controller, String actionMethod) {
        HttpMethod method = HttpMethod.getMethod(RequestContext.getHttpRequest());
        if (!controller.actionSupportsHttpMethod(actionMethod, method)) {
            DirectResponse res = new DirectResponse("");
            //see http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
            res.setStatus(405);
            LOGGER.warn("Requested action does not support HTTP method: " + method.name() + ", returning status code 405.");
            RequestContext.setControllerResponse(res);

            //TODO: candidate for caching below, list of allowed HTTP methods
            //see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
            RequestContext.getHttpResponse().setHeader("Allow", join(controller.allowedActions(actionMethod), ", "));
            return false;
        }
        return true;
    }
438798
public RouteMatcher patch(String pattern, Handler<HttpServerRequest> handler) {
		addPattern(pattern, handler, patchBindings);
		return this;
	}
1238751
public static Route PATCH(String uriPattern, RouteHandler routeHandler) {
        return new Route(HttpConstants.Method.PATCH, uriPattern, routeHandler);
    }
811866
def patch(query_url,
              headers: {},
              parameters: {})
      HttpRequest.new(HttpMethodEnum::PATCH,
                      query_url,
                      headers: headers,
                      parameters: parameters)
    end
1119297
public static HttpRequestHeader changeMethod(String method, String header, String body) throws URIException, HttpMalformedHeaderException {
		HttpRequestHeader hrh = new HttpRequestHeader(header);
		URI uri = hrh.getURI();
		String prevMethod = hrh.getMethod();
		if (prevMethod.equalsIgnoreCase(method)) {
			return hrh;
		}
		if (prevMethod.equals(HttpRequestHeader.POST)) {
			// Was POST, move all params onto the URL
			if (body != null && body.length() > 0) {
				StringBuilder sb = new StringBuilder();
				if (uri.getQuery() != null) {
					sb.append(uri.getQuery());
				}

				String [] params = body.split("&");
				for (String param : params) {
					if (sb.length() > 0) {
						sb.append('&');
					}
					String[] nv = param.split("=");
					if (nv.length == 1) {
						// This effectively strips out the equals if theres no value 
						sb.append(nv[0]);
					} else {
						sb.append(param);
					}
				}
				uri.setQuery(sb.toString());

			}
			hrh.setURI(uri);
			// Clear the body
			body = "";

		} else if (method.equals(HttpRequestHeader.POST)) {
			// To be a port, move all URL query params into the body
			String query = uri.getQuery();
			if (query != null) {
				StringBuilder sb = new StringBuilder();
				String [] params = query.split("&");
				for (String param : params) {
					if (sb.length() > 0) {
						sb.append('&');
					}
					sb.append(param);
					String[] nv = param.split("=");
					if (nv.length == 1) {
						// Cope with URL params with no values e.g. http://www.example.com/test?key
						sb.append('=');
					}
				}
				// fixed: dead store to variable body by commenting the following line
				// body = sb.toString();
				uri.setQuery(null);
				hrh.setURI(uri);
			}
		}
		hrh.setMethod(method);
		
		return hrh;
	}
47615
def check_method_allowed(cls, request):
        
        if not request.method in cls._meta.allowed_methods:
            raise HttpError(
                'Method \'%s\' not allowed on this resource.' % request.method,
                status=status.HTTP_405_METHOD_NOT_ALLOWED)
587063
function onPatchesDerive() {
		var patches = this.patches;
		this.patches = [];
		queues.enqueueByQueue(this.handlers.getNode([]), this.currentList, [patches, this.currentList], null,["Apply patches", patches]);
	}
1099773
public function patch(ResourceManager $resourceManager, ApiRequest $request, int $version, string $resource, $id)
    {
        $resourceManager->version($version);

        /** @var \Ipunkt\LaravelJsonApi\Contracts\RequestHandlers\HandlesPatchRequest $handler */
        $handler = $this->initializeHandler($resourceManager, $resource, $request, HandlesPatchRequest::class);

        $parameters = $request->asParameters();

        $result = $handler->patch($id, $request, $parameters);

        if ($result === true) {
            return $this->respondNoContent();
        }
        if ($result === false) {
            //  @TODO: Result false means nothing changed! Result okay? Wishful changes are set, so okay is fine.
            return $this->respondNoContent();
        }

        $document = $this->makeDocumentFromResource($resourceManager, $resource, $result, $parameters, $handler);

        return $this->respond($document);
    }
529614
function(number, params, headers, callback) {
        var url;
        url = this.client.url() + ("posts/" + (number || ''));
        return this.client.patch(url, params, headers, callback);
      }
676812
public static RequestResponse callHttpPatch(HttpJsonRpcClient client, String url,
            Map<String, Object> headers, Map<String, Object> urlParams, Object requestData) {
        return client.doPatch(url, headers, urlParams, requestData);
    }
601749
@SuppressWarnings("unchecked")
  public HttpMethodInfo handle(HttpRequest request,
                               HttpResponder responder, Map<String, String> groupValues) throws Exception {
    //TODO: Refactor group values.
    try {
      if (httpMethods.contains(request.method())) {
        //Setup args for reflection call
        Object [] args = new Object[paramsInfo.size()];

        int idx = 0;
        for (Map<Class<? extends Annotation>, ParameterInfo<?>> info : paramsInfo) {
          if (info.containsKey(PathParam.class)) {
            args[idx] = getPathParamValue(info, groupValues);
          }
          if (info.containsKey(QueryParam.class)) {
            args[idx] = getQueryParamValue(info, request.uri());
          }
          if (info.containsKey(HeaderParam.class)) {
            args[idx] = getHeaderParamValue(info, request);
          }
          idx++;
        }

        return new HttpMethodInfo(method, handler, responder, args, exceptionHandler);
      } else {
        //Found a matching resource but could not find the right HttpMethod so return 405
        throw new HandlerException(HttpResponseStatus.METHOD_NOT_ALLOWED, String.format
          ("Problem accessing: %s. Reason: Method Not Allowed", request.uri()));
      }
    } catch (Throwable e) {
      throw new HandlerException(HttpResponseStatus.INTERNAL_SERVER_ERROR,
                                 String.format("Error in executing request: %s %s", request.method(),
                                               request.uri()), e);
    }
  }
289011
private void executeRequest(HttpMethod httpMethodProxyRequest,
                                HttpServletRequest httpServletRequest,
                                PluginResponse httpServletResponse,
                                History history) throws Exception {
        int intProxyResponseCode = 999;
        // Create a default HttpClient
        HttpClient httpClient = new HttpClient();
        HttpState state = new HttpState();

        try {
            httpMethodProxyRequest.setFollowRedirects(false);
            ArrayList<String> headersToRemove = getRemoveHeaders();

            httpClient.getParams().setSoTimeout(60000);

            httpServletRequest.setAttribute("com.groupon.odo.removeHeaders", headersToRemove);

            // exception handling for httpclient
            HttpMethodRetryHandler noretryhandler = new HttpMethodRetryHandler() {
                public boolean retryMethod(
                    final HttpMethod method,
                    final IOException exception,
                    int executionCount) {
                    return false;
                }
            };

            httpMethodProxyRequest.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, noretryhandler);

            intProxyResponseCode = httpClient.executeMethod(httpMethodProxyRequest.getHostConfiguration(), httpMethodProxyRequest, state);
        } catch (Exception e) {
            // Return a gateway timeout
            httpServletResponse.setStatus(504);
            httpServletResponse.setHeader(Constants.HEADER_STATUS, "504");
            httpServletResponse.flushBuffer();
            return;
        }
        logger.info("Response code: {}, {}", intProxyResponseCode,
                    HttpUtilities.getURL(httpMethodProxyRequest.getURI().toString()));

        // Pass the response code back to the client
        httpServletResponse.setStatus(intProxyResponseCode);

        // Pass response headers back to the client
        Header[] headerArrayResponse = httpMethodProxyRequest.getResponseHeaders();
        for (Header header : headerArrayResponse) {
            // remove transfer-encoding header.  The http libraries will handle this encoding
            if (header.getName().toLowerCase().equals("transfer-encoding")) {
                continue;
            }

            httpServletResponse.setHeader(header.getName(), header.getValue());
        }

        // there is no data for a HTTP 304 or 204
        if (intProxyResponseCode != HttpServletResponse.SC_NOT_MODIFIED &&
            intProxyResponseCode != HttpServletResponse.SC_NO_CONTENT) {
            // Send the content to the client
            httpServletResponse.resetBuffer();
            httpServletResponse.getOutputStream().write(httpMethodProxyRequest.getResponseBody());
        }

        // copy cookies to servlet response
        for (Cookie cookie : state.getCookies()) {
            javax.servlet.http.Cookie servletCookie = new javax.servlet.http.Cookie(cookie.getName(), cookie.getValue());

            if (cookie.getPath() != null) {
                servletCookie.setPath(cookie.getPath());
            }

            if (cookie.getDomain() != null) {
                servletCookie.setDomain(cookie.getDomain());
            }

            // convert expiry date to max age
            if (cookie.getExpiryDate() != null) {
                servletCookie.setMaxAge((int) ((cookie.getExpiryDate().getTime() - System.currentTimeMillis()) / 1000));
            }

            servletCookie.setSecure(cookie.getSecure());

            servletCookie.setVersion(cookie.getVersion());

            if (cookie.getComment() != null) {
                servletCookie.setComment(cookie.getComment());
            }

            httpServletResponse.addCookie(servletCookie);
        }
    }
272142
function patchMakeErrFromCode() {
  const func = errors.makeErrFromCode;
  function makeErrFromCodeHook() {
    const err = func.apply(null, arguments);
    patchErrorBody(err, {});
    return err;
  }
  errors.makeErrFromCode = makeErrFromCodeHook;

  // Deprecated.
  // See https://github.com/restify/errors/blob/master/lib/index.js#L126
  errors.codeToHttpError = makeErrFromCodeHook;
}