invantive documentationpart of invantive cloud
Invantive Support ForumsLog In / Sign Up

HTTPGET

Syntax

%%{init: {
  'theme': 'base',
  'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
  'themeVariables': {
    'fontSize': '11px',
    'fontFamily': 'Arial'
  }
}}%%
flowchart LR
    Start((START)) --> HTTPGET[HTTPGET]:::quoted
    HTTPGET --> End((END))

Purpose

The HTTPGET SQL function retrieves the HTTP response on a GET from 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_TEXT and HTTPPOST.

Parameters:

  • URL (varchar2): the URL to GET the data from.
  • 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 retrieval returns null instead of terminating the statement. Defaults to false.

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. That is where the reason for a null is found when ignore web error is set.

Examples

The following example retrieves the BLOB from the HTTP response on https://cloud.invantive.com:

select to_hex(httpget('https://cloud.invantive.com'))

----------------
3C21444F43545950452068746D6C3E0D0A3C68746D6C206C616E673D226...

The following example retrieves the HTTP response on a null URL; the output is empty:

select httpget(null)

----------------