Updating parts of a resource on the server
This note provides supplementary information about the server's implementation of the standard HTTP PATCH method, used to replace portions of a resource.
PATCH method is used by interactive AJAX calls to request the server to update portions of an existing resource.
A software developer must write a custom module with a handler to carry out the request (presumably via some type of server database), and the webmaster must configure a dynamic route with
*methods=PATCH which references that module.
The server's request/response cycle for
PATCH requests is fulfilled using this sequence of handlers:
|1||Server Name Indication||no||no|
|12||WWW Form Data||no||no|
|13||Multipart Form Data||no||no|
Successful responses are finalized by the dynamic module with any of these status codes:
200"OK" when the response contains a payload and these response headers:
204"No Content" when the response has no payload.
207"Multi Status" with a payload that has individual status codes for each part of the multipart request.
303"See Other" when the processing is successful and the browser should issue a follow-on
GETrequest to the URI declared in the response's
307"Temporary Redirect" when the processing is successful and the browser should issue a follow-on
PATCHrequest to the URI declared in the response's
PATCH requests must contain a
content-length header. If not present, the request will fail with a status code of
411 and an information header of
The maximum size of a file to be uploaded is limited by the server to the size configured in
restrictions/content-length-limit. If the file is too large, the request will fail with a status code of
413 and an information header of
PATCH requests may be uploaded in compressed form if the request includes an acceptable
content-encoding header with a value of
'deflate'. The uploaded request body will be decompressed and made available to plugin work orders in uncompressed form.
The request will fail with status code
406 if the Content Encoding module is not enabled or if the encoding value is not acceptable. An
rw-content-decoding information header is added to this type of unsuccessful response.
For reference purposes, refer to IETF RFC 5789 PATCH Method for HTTP for the basic protocol expected of