oracle 如何在plsql中打印最终的UTL_HTTP头

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

如何在PL/SQL中打印最终的UTL_HTTP
下面(1)来自Soapui的UTL_HTTP头,我们通过UTL_HTTP方法从PL/SQL代码设置,我想打印此PL/SQL代码(2)
(1)编码:UTF-8标头:{SOAPAction=[setServiceInventoryDetails],content-length=[16549],Authorization:基本VGVzdGVyOIRIc3Q=,host=[adoptu2luat.test.att.com],connection=[keep-alive,close],content-type=[text/xml; charset=UTF-8],user-agent=[Mozilla/4.0]},env:Envelope body</env:Envelope>
1.如何打印DBMS_OUT.put_line以了解最终的soap UTL Header?

l_http_request := utl_http.begin_request(url => p_url, method => 'POST', http_version => 'HTTP/1.1');
utl_http.set_header(l_http_request, 'User-Agent', 'Mozilla/4.0');
utl_http.set_header(l_http_request, 'Authorization', 'Basic ' || ws_unpw);  --cj208w
utl_http.set_header(l_http_request, 'Connection', 'close');
utl_http.set_header(l_http_request, 'Connection', 'keep-alive');
utl_http.set_header(l_http_request, 'Content-Type', 'text/xml;charset=UTF-8');
yv5phkfx

yv5phkfx1#

这是我用的

BEGIN
    vlength := dbms_lob.getlength(request_body);
    owa_util.mime_header(ccontent_type => ''text/plain'',
                         bclose_header =>  true,
                         ccharset => ''ISO-8859-4'');
    HTP.p(''List from PRINT_CGI_ENV including <br /> terminator:'');
    HTP.p(''======================================================='');
    OWA_UTIL.print_cgi_env;
    htp.p(''Content-length: '' || vlength);
    HTP.p(''Request Body:'');
    HTP.p(''======================================================='');
     htp.p(request_body);
END;');

然后,当它可以通过我的REST API时,我会得到这样的东西-

More info here where I talk about debugging your REST APIs in Oracle Database.

相关问题