Executes a PATCH request.

@param uri     url of resource.
@param content content to be posted.
@return {@link Patch} object.
978247
public static Patch patch(String uri, String content) {
        return patch(uri, content.getBytes(), CONNECTION_TIMEOUT, READ_TIMEOUT);
    }
236029
public static Patch patch(String url, byte[] content, int connectTimeout, int readTimeout) {

        try {
            return new Patch(url, content, connectTimeout, readTimeout);
        } catch (Exception e) {
            throw new HttpException("Failed URL: " + url, e);
        }
    }
254904
public static Put put(String uri, byte[] content) {
        return put(uri, content, CONNECTION_TIMEOUT , READ_TIMEOUT);
    }
1146295
@Override
    public Uri insert(Uri uri, ContentValues values) {
        Uri result = null;

        if (!controller.hasPreinitialized()) {
            throw new IllegalStateException("Controller has not been initialized.");
        }

        int patternCode = controller.getUriMatcher().match(uri);
        MatcherPattern pattern = controller.findMatcherPattern(patternCode);
        if (pattern == null) {
            throw new IllegalArgumentException("unknown uri : " + uri.toString());
        }

        Parameter parameter = new Parameter(uri, values);
        SQLiteDatabase db = this.getHelper().getWritableDatabase();

        result = onInsert(this.getHelper(), db, pattern, parameter);
        if (result != null) {
            this.onInsertCompleted(result, uri, pattern, parameter);
        }
        return result;
    }
1254292
public void put(URI uri, String mimetype, byte[] content,
			Credentials credentials) throws IOException {
		put(uri, mimetype, content, null, credentials);
	}
763854
function patch(patchURI, patch, callback) {

  util.patch(patchURI, patch, function(err, res) {
    if (err) {
      callback(err)
    } else {
      callback(null, res)
    }
  })
}
241850
public static Post post(String uri, String content) {
        return post(uri, content.getBytes(), CONNECTION_TIMEOUT, READ_TIMEOUT);
    }
1060510
public static String urlEncode(String content, Charset charset, TestContext context) {
        return new UrlEncodeFunction().execute(Arrays.asList(content, charset.displayName()), context);
    }
739161
public function patch($uri, $content, $requestHeaders = array()) {
        try {
            return $this->executePatch($uri, $content, $requestHeaders);
        } catch (Unauthenticated $e) {
            $this->auth_token->reset();
            return $this->executePatch($uri, $content, $requestHeaders);
        }
    }
490948
public static String urlDecode(String content, TestContext context) {
        return new UrlDecodeFunction().execute(Collections.singletonList(content), context);
    }
529501
protected void executePatchRequest(URI uri, Object obj)
    {
        executePatchRequest(uri, obj, null, null);
    }
1347590
function(articleContent) {
    var baseURI = this._doc.baseURI;
    var documentURI = this._doc.documentURI;
    function toAbsoluteURI(uri) {
      // Leave hash links alone if the base URI matches the document URI:
      if (baseURI == documentURI && uri.charAt(0) == "#") {
        return uri;
      }
      // Otherwise, resolve against base URI:
      try {
        return new URL(uri, baseURI).href;
      } catch (ex) {
        // Something went wrong, just return the original:
      }
      return uri;
    }

    var links = articleContent.getElementsByTagName("a");
    this._forEachNode(links, function(link) {
      var href = link.getAttribute("href");
      if (href) {
        // Replace links with javascript: URIs with text content, since
        // they won't work after scripts have been removed from the page.
        if (href.indexOf("javascript:") === 0) {
          var text = this._doc.createTextNode(link.textContent);
          link.parentNode.replaceChild(text, link);
        } else {
          link.setAttribute("href", toAbsoluteURI(href));
        }
      }
    });

    var imgs = articleContent.getElementsByTagName("img");
    this._forEachNode(imgs, function(img) {
      var src = img.getAttribute("src");
      if (src) {
        img.setAttribute("src", toAbsoluteURI(src));
      }
    });
  }
1304676
public static HttpConnection createPost(URI uri, String body, String contentType) {
        HttpConnection connection = Http.POST(uri, "application/json");
        if(body != null) {
            setEntity(connection, body, contentType);
        }
        return connection;
    }
615122
def _patch_file(path, content):
    """"""
    f = open(path)
    existing_content = f.read()
    f.close()
    if existing_content == content:
        # already patched
        log.warn('Already patched.')
        return False
    log.warn('Patching...')
    _rename_path(path)
    f = open(path, 'w')
    try:
        f.write(content)
    finally:
        f.close()
    return True
771868
@Override
  public Request newRequest(URI uri) {
    Request request = super.newRequest(uri);
    Request.Listener listener = new HttpRequestListener(tracer.getCurrentSpan(), handler);
    request.listener(listener);
    request.onComplete((Response.CompleteListener) listener);
    request.onResponseContent((Response.ContentListener) listener);
    return request;
  }
508564
public static String urlDecode(String content, Charset charset, TestContext context) {
        return new UrlDecodeFunction().execute(Arrays.asList(content, charset.displayName()), context);
    }
838232
function ( uri ) {
		var cached = cache.get( uri, false ),
		    bit    = !cached ? 0 : cached.permission,
		    result = {allows: [], bit: bit, map: {partial: 8, read: 4, write: 2, "delete": 1, unknown: 0}};

		if ( bit & 1) {
			result.allows.push( "DELETE" );
		}

		if ( bit & 2) {
			result.allows.push( "POST" );
			result.allows.push( "PUT" );
		}

		if ( bit & 4) {
			result.allows.push( "GET" );
		}

		if ( bit & 8) {
			result.allows.push( "PATCH" );
		}

		return result;
	}