Hello everyone,
On Oracle19, I'm calling some api from a site like this :
select utl_http.request('https://site_name.com/path/v1/api?accessToken=xxxxxxxxxxx',null,'file:/oracle/path/ora_wallet','xxxxx') from dual;
and it works just fine.
Problem occur when I try to do this in a pl/sql block :
....
begin
utl_tcp.close_all_connections;
utl_http.set_wallet('file:/oracle/path/ora_wallet', 'xxxxx');
l_http_request := utl_http.begin_request(url => l_host_name, method => 'GET', http_version => 'HTTP/1.1');
utl_http.set_header(l_http_request, 'Content-Type', 'application/json; charset=UTF-8');
utl_http.set_header(l_http_request, 'Content-Length', LENGTH(l_string_request));
utl_http.write_text(l_http_request, l_string_request);
l_http_response := UTL_HTTP.get_response(l_http_request);
DBMS_OUTPUT.put_line('Response> status_code: "' || l_http_response.status_code || '"');
DBMS_OUTPUT.put_line('Response> reason_phrase: "' ||l_http_response.reason_phrase || '"');
DBMS_OUTPUT.put_line('Response> http_version: "' ||l_http_response.http_version || '"');
.....
The server/site answer's is :
Response> status_code: "400"
Response> reason_phrase: "Bad Request"
Response> http_version: "HTTP/1.1"
Response> length: "699"
[00]: <html style="height:100%"><head><META NAME="ROBOTS
[01]: " CONTENT="NOINDEX, NOFOLLOW"><meta name="format-d
[02]: etection" content="telephone=no"><meta name="viewp
[03]: ort" content="initial-scale=1.0"><meta http-equiv=
[04]: "X-UA-Compatible" content="IE=edge,chrome=1"></hea
[05]: d><body style="margin:0px;height:100%"><iframe id=
[06]: "main-iframe" src="/_Incapsula_Resource?CWUDNSAI=2
[07]: 4&xinfo=9-8837669-0%200NNN%20RT%281739378424246%20
[08]: 63%29%20q%28-1%20-1%20-1%20-1%29%20r%280%20-1%29%2
[09]: 0b1&incident_id=0-38992745431434697&edet=3&cinfo=f
[10]: fffffff&pe=1454&rpinfo=0&mth=GET" frameborder=0 wi
[11]: dth="100%" height="100%" marginheight="0px" margin
[12]: width="0px">Request unsuccessful. Incapsula incide
[13]: nt ID: 0-38992745431434697</iframe></body></html>
So the question is how does the utl_http.begin_request differ from utl_http.request with respect to how the site/server is handling the requests it receive ?
Thank you.