Hi all,
I have created a simple REST API in ORDS, defining methods manually through APEX Interface.
I tested the interface successfully from the Browser, Postman and also an APEX Simple Report.
However, when trying to call the API from PL/SQL, I get an error "ORA-29259: end-of-input reached" when obtaining the response. The code is the following:
declare
req utl_http.req;
res utl_http.resp;
url varchar2(4000) := 'http://apex.oracle.com/pls/apex/dbento1/prueba/dept/';
buffer varchar2(32000);
begin
req := utl_http.begin_request(url, 'GET');
dbms_output.put_line('begin request success');
res := utl_http.get_response(req); -- at this point I get ORA-29259 end-of-input reached
dbms_output.put_line('get response success');
-- process the response from the HTTP call
begin
loop
utl_http.read_line(res, buffer);
dbms_output.put_line(buffer);
end loop;
utl_http.end_response(res);
exception
when utl_http.end_of_body then
utl_http.end_response(res);
end;
end;
Any help will be sincerely appreciated.
Thanks in advance,
David