Oracle UTL_HTTP.Request
-- PL/SQL Code to get http request data
-- In the code below just first 200 characters are 
-- displayed (as shown in figure 1).  The same can
-- also be queried as

SELECT UTL_HTTP.request('http://www.oracle.com/') 
 utl_http_request
FROM DUAL;

SET SERVEROUTPUT ON SIZE 1000000;

DECLARE
   v_html   VARCHAR2(4000); 
BEGIN 
   v_html := UTL_HTTP.REQUEST('http://www.oracle.com/');
   DBMS_OUTPUT.PUT_LINE(SUBSTR(v_html,1,100));
   DBMS_OUTPUT.PUT_LINE(SUBSTR(v_html,101,200));
   DBMS_OUTPUT.PUT_LINE(' Request Size --> '||LENGTH(v_html));
END;
/

Figure 1: Oracle UTL_HTTP.Request Output
Oracle UTL_HTTP.Request Output

Oracle registered trademark of Oracle Corporation.

Last Revised On: August 10, 2014

  72973