Start of change

HTTP_PATCH and HTTP_PATCH_BLOB

The HTTP_PATCH Start of changeor HTTP_PATCH_BLOBEnd of change scalar function updates a text-based resource under the specified URL through an HTTP PATCH request.

Read syntax diagramSkip visual syntax diagramHTTP_PATCHHTTP_PATCH_BLOB(url ,request-message,options)
url
An expression that returns a built-in character string or graphic string data type that specifies the URL of the resource being accessed.
The only supported protocols in the URL are http:// and https://. HTTP basic authentication in the form https://userid:password@ cannot be specified in the URL. Instead, the basicAuth option must be used to specify the userid and password for basic authentication.
request-message
An expression that specifies the data to update at the specified URL.
For HTTP_PATCH, it must be a built-in character string or graphic string data type.
Start of changeFor HTTP_PATCH_BLOB, it must be a built-in binary string data type.End of change
options
An expression that returns a built-in character string or graphic string data type. This string must be formatted as a JSON object containing the options, including headers, for the request. See HTTP options for the list of options.
If no options are provided, the default options are used.

The result of the HTTP_PATCH function is CLOB(2G) CCSID 1208 containing the response message. Start of changeThe result of the HTTP_PATCH_BLOB function is BLOB(2G) containing the response message.End of change

Notes

For more information about using the HTTP functions see HTTP functions overview.

To return the header information from the HTTP request, use the HTTP_PATCH_VERBOSE Start of changeor HTTP_PATCH_BLOB_VERBOSEEnd of change table function: HTTP_PATCH_VERBOSE and HTTP_PATCH_BLOB_VERBOSE

Example

  • Send a HTTP PATCH request to https://www.example.com/users sending 'ABC' and using the certificate store /home/javaTrustStore/fromJava.KDB and return the result.
    VALUES QSYS2.HTTP_PATCH('https://www.example.com/users',
                           'ABC',
                           '{"sslCertificateStoreFile":"/home/javaTrustStore/fromJava.KDB"}');
End of change