'How to fix the error of "HTTP request failed" while calling an API in a oracle procedure?
I am trying to call an API from a procedure in oracle , for a demo purpose I tried calling a web page but its giving me error : *Cause: The UTL_HTTP package failed to execute the HTTP request.
Set serveroutput on ;
DECLARE
req UTL_HTTP.REQ;
resp UTL_HTTP.RESP;
value VARCHAR2(1024);
BEGIN
req := UTL_HTTP.BEGIN_REQUEST('http://www.nyquest.com');
resp := UTL_HTTP.GET_RESPONSE(req);
LOOP
UTL_HTTP.READ_LINE(resp, value, TRUE);
dbms_output.put_line(value);
END LOOP;
UTL_HTTP.END_RESPONSE(resp);
EXCEPTION
WHEN UTL_HTTP.END_OF_BODY THEN
UTL_HTTP.END_RESPONSE(resp);
END;
Please guide me in fixing this error .
Solution 1:[1]
Most likely you didnt created ACL's. Your database needs it before it is going to accept connections from outside.
You can read about it here: Oracle Access Control List
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Bartosz Olchowik |
