Start of change

HTTPGETBLOB and HTTPGETCLOB scalar functions

The HTTPGETBLOB and HTTPGETCLOB REST functions retrieve a binary or text-based resource from the specified URL through an HTTP GET request.

Read syntax diagramSkip visual syntax diagram HTTPGETBLOBHTTPGETCLOB ( URL => url , HTTPHEADER =>  httpHeader )
The schema is SYSTOOLS.
url
Specifies the URL of the resource being accessed. This parameter is a VARCHAR(2048) CCSID 1208 value.
httpHeader
Specifies an optional header XML document. To use the default HTTP header, specify NULL or the empty string. This parameter is a CLOB(10K) CCSID 1208 or XML value.
See Foundational HTTP functions for a description of the header content.

HTTPGETBLOB returns the resource as BLOB(2G) data. HTTPGETCLOB returns the resource as CLOB(2G) CCSID 1208 data.

Example

SELECT SYSTOOLS.HTTPGETCLOB(                            
  URL => CAST('http://ws.geonames.org/countryInfo?lang=' CONCAT 
          SYSTOOLS.URLENCODE('en','') CONCAT                 
          '&country=' CONCAT
          SYSTOOLS.URLENCODE('us','') CONCAT
          '&type=XML' AS VARCHAR(255)),
  HTTPHEADER => CAST(NULL AS CLOB(1K)))
FROM SYSIBM.SYSDUMMY1;    
End of change