HTTP_POST and HTTP_POST_BLOB
The HTTP_POST or HTTP_POST_BLOB scalar function updates a text-based resource under the specified URL through an HTTP POST request.
- url
- An expression that returns a built-in character string or graphic string data type that specifies the URL of the resource being accessed.
- request-message
- An expression that specifies the data to update at the specified URL.
- 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.
The result of the HTTP_POST function is CLOB(2G) CCSID 1208 containing the response message. The result of the HTTP_POST_BLOB function is BLOB(2G) containing the response message.
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_POST_VERBOSE or HTTP_POST_BLOB_VERBOSE table function: HTTP_POST_VERBOSE and HTTP_POST_BLOB_VERBOSE
Example
- Send a HTTP POST 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_POST('https://www.example.com/users', 'ABC', '{"sslCertificateStoreFile":"/home/javaTrustStore/fromJava.KDB"}');