如何在Oracle日志中打印HTTP请求

ahy6op9u  于 2023-06-29  发布在  Oracle
关注(0)|答案(1)|浏览(169)

我们使用UTL_HTTP方法调用外部URL,并设置HTTP头,如basic authenticationkeep alivecontentsoap action,因此我需要打印我设置的头。

DBMS_OUTPUT.put_line('l_http_request-'||l_http_request); -- not working

下面是代码

UTL_HTTP.set_header(l_http_request, 'Content-Type', 'text/xml;charset=UTF-8');
    if soap_action is not null then
    
        UTL_HTTP.set_header(l_http_request, 'SOAPAction', soap_action);
    end if;
    UTL_HTTP.set_header(l_http_request, 'Content-Length', LENGTH(request_clob));

DBMS_OUTPUT.put_line('l_http_request-'||l_http_request); ---how to print this
mpgws1up

mpgws1up1#

按设置打印它们:

UTL_HTTP.set_header(l_http_request, 'Content-Type', 'text/xml;charset=UTF-8');

DBMS_OUTPUT.PUT('l_http_request');

if soap_action is not null then
  UTL_HTTP.set_header(l_http_request, 'SOAPAction', soap_action);
  DBMS_OUTPUT.PUT(' - SOAPAction=' || soap_action);
end if;

UTL_HTTP.set_header(l_http_request, 'Content-Length', LENGTH(request_clob));
DBMS_OUTPUT.PUT(' - Content-Length=' || LENGTH(request_clob));

DBMS_OUTPUT.NEW_LINE;

相关问题