Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Gateway Timeout error while calling a rest API from APEX

SandipanJul 11 2024

We are trying to make a successful REST API call from our APEX Instance to an external system. The API is responding well when called using Postman. But whenever we are trying to call it using apex_web_service API, it's ending with Gateway Timeout error.

Kindly suggest how to troubleshoot the error or what additional configuration changes are recommended if there is any network blocker.

-- APEX_WEB_SERVICE.MAKE_REST_REQUEST
-- Calling a REST Service which uses the API Key in the HTTP Header
DECLARE
l_body CLOB;
l_response CLOB;
BEGIN

apex_web_service.clear_request_headers;
apex_web_service.g_request_headers(1).name := 'Content-Type';
apex_web_service.g_request_headers(1).value := 'text/plain';

l_body := '<<<<<<< Fixed Length Data >>>>>>';

l_response := apex_web_service.make_rest_request (
p_url => 'https://internaldns/api/public/d2p4/subscriber',
p_http_method => 'PUT',
p_body => l_body );

dbms\_output.put\_line('Response: '||l\_response);  

EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('Error : '||SQLERRM);

END;

Thanks

Sandipan

Comments
Post Details
Added on Jul 11 2024
2 comments
573 views