HTTPPOST
Syntax
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> HTTPPOST[HTTPPOST]:::quoted
HTTPPOST --> End((END))
Purpose
The HTTPPOST SQL function retrieve the HTTP response on a POST to a URL as a BLOB (blob).
The URL must be accessible. Use the NativePlatformScalarRequest view on cloud applications to directly access their APIs with credentials and rate limiters.
See also HTTPGET and HTTPGET_TEXT.
Parameters:
- URL (
varchar2): the URL to POST the data to. - Content type (
varchar2): the content type of the HTTP POST request. - Payload (
blob): the BLOB to POST to the URL. - Time-out (optional,
int64): the number of milliseconds to wait for the counterparty to answer. Defaults to 30 000. - Ignore web error (optional,
boolean): whether a failed request returnsnullinstead of terminating the statement. Defaults tofalse.
Returns: the HTTP response data as a blob.
Every attempt is registered in Invantive-HTTPDOWNLOADHISTORY with its HTTP status code and error message, whether it succeeded, failed or was ignored.
Examples
The following example posts a BLOB to an online echo server and retrieves the payload:
select httppost('https://echotest.acme.eu', 'application/octet-stream', random_blob(4096))
----------------
[BLOB]
The following example posts to a null URL; the output is empty:
select httppost(null, null, null)
----------------