DB2 web requests

A lot of the new features on the IBM i are around advances in the DB2 database functionality.  One such useful function is the ability to make web requests using SQL. The upshot of this is that you can now embed SQL into your RPG programs to consume web services.

These functions work by retrieving the the data returned into variables that are defined by the new SQLTYPE keywords. They include CLOB and BLOB types which result in data structures being created.

The following SQL will return the header and response for a web service call using the POST method to the endpoint, passing the header and payload.

select responseHttpHeader ,responseMsg
from table(systools.httppostclobverbose
           (
            <endpoint_url>,
            <httpHeader>, 
            <payload> 
            )
           )

Here is a link to the IBM document that has some deeper explanations to what else you can get up to with it.  Have fun!