Skip to content

Commit

Permalink
Add PATCH method
Browse files Browse the repository at this point in the history
  • Loading branch information
awwright committed Nov 23, 2019
1 parent 736236a commit f689b41
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions web/http/methods/PATCH.xml
@@ -0,0 +1,40 @@
<!DOCTYPE html>
<html lang="en" dir="ltr"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:w="tag:fullstack.wiki,2018:ns/"
xmlns:xht="http://www.w3.org/1999/xhtml/vocab#"
>
<head>
<meta charset="UTF-8" />
<title>PATCH</title>
<meta name="description" content="PATCH modifies the target resource according to the given instructions" />
<link rel="up" href="index.xml" />
</head>
<body>
<main about="tag:fullstack.wiki,2018:ns/http/methods/PATCH" typeof="w:HTTP-Method">
<a rel="http://www.w3.org/1999/xhtml/vocab#describedby" href="" />

<h1>PATCH</h1>
<p>The PATCH allows a client to modify a resource according to provided instructions. This can include a applying a diff.</p>

<h2>Writing requests (clients)</h2>
<p>If a client wants to modify a specific part of a resource without overwriting the entire document, it should use the PATCH method with a media type that can express the desired change; if this is available on the server.</p>
<p>If applicable, send the request with a <a href="../conditional.xml">conditional test (e.g. If-Match)</a>, to avoid creating the resource in the event it does not exist.</p>
<p>Check the error code and follow the error recovery process, <a href="../status-codes/405.xml">405 (Method Not Allowed)</a>, <a href="../status-codes/415.xml">415 (Unsupported Media Type)</a>, or <a href="../status-codes/501.xml">501 (Not Implemented)</a> may require that the request be retried with an equivelant PUT request.</p>

<h2>Reading requests (servers)</h2>
<p>Servers that use <a href="../status-codes/428.xml">428 (Precondition Required)</a> should judge if the patch media-type has sufficient information to avoid lost updates. If the patch can only be applied if the document is in an expected state, then the server should not require a precondition header, since this would be redundant.</p>
<p>Check the <a href="../preferences/return.xml">"return"</a> preference for guidence on what response should be generated. By default, return a short document summarizing the changes made.</p>

<h2>Overview table</h2>
<dl class="inline">
<dt>Name</dt>
<dd property="w:HTTP-Method-name">PATCH</dd>
<dt>Description</dt>
<dd property="w:HTTP-Method-description">Modifies the target resource according to the given instructions.</dd>
<dt>Specification</dt>
<dd property="w:specification"><a href="https://httpwg.org/specs/rfc5789.html">RFC 5789: PATCH Method for HTTP</a></dd>
</dl>
</main>
</body>
</html>

0 comments on commit f689b41

Please sign in to comment.