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