The PatchData method is used to submit XML or JSON formatted
patch data to a service, and then returns a copy of the response from
the server into a local string buffer. This method will not perform any
encoding and will not automatically define the type of patch data being
submitted. Your application is responsible for specifying the content
type for the patch data, and ensuring that the XML or JSON data that is
being submitted to the server is formatted correctly.
This method sends a PATCH command to the server, which is similar
to a POST or PUT request. It is used to make partial updates to a
resource, rather than creating or replacing it entirely. The format of
the patch data is specific to the service being used. If the resource
being patched does not exist, the behavior is defined by the server.
If enough information is provided, it may choose to create the
resource just as if a PUT command was used, or it may return an error.
Your application should use the SetHeader method to
define the Content-Type header prior to calling the PatchData
method. One of the most common formats used is the JSON Merge Patch
which is defined in RFC 7396. The value for the Content-Type header
for this patch format is "application/merge-patch+json". Refer to your
service API documentation to determine what patch formats are
acceptable, along with any additional header values that must be
This method will cause the current thread to block until the
operation completes, a timeout occurs or the post is canceled. During
the operation, the OnProgress event will fire periodically,
enabling the application to update any user interface objects such as
a progress bar.