1 Reply Latest reply on Jan 9, 2020 8:22 PM by mdtaylor

    How to: HTTPS call to API using sql

    3762639

      I have an external https url to which I need to POST a JSON call. The call works fine with POSTMAN. I send the JSON request and I get the nice JSON reply.

      But when I try to use the same in PL/SQL, It is returning the following errors:

      ORA-29273: HTTP request failed

      ORA-29024: Certificate validation failure

      ORA-06512: at "SYS.UTL_HTTP", line 368

      ORA-06512: at "SYS.UTL_HTTP", line 1118

      ORA-06512: at line 41

       

      What is different in POSTMAN that it works without a Certificate but does not work in PL/SQL?

      My code is:

       

      req := UTL_HTTP.begin_request(l_http_auth_url, 'POST','HTTPS/1.1'); -- https url

      utl_http.set_header(req, 'Content-Type', 'application/raw' ); -- 'application/json');   

      utl_http.set_header(req, 'Content-Length', length(content));

      utl_http.set_header(req, 'Content-Length', length(content));

        utl_http.write_text(req, content); -- content is the json

       

      Can you please help me?

      I had created an SR and there is no response from the Oracle team.