我尝试了以下方法来进行HTTP调用:
v_doc_fin clob;
if v_doc_fin is not null then
DBMS_OUTPUT.PUT_LINE (v_doc_fin);
req := utl_http.begin_request(url, 'POST',' HTTP/1.1');
utl_http.set_header(req, 'user-agent', 'mozilla/4.0');
utl_http.set_header(req, 'content-type', 'application/json');
utl_http.set_header(req, 'Content-Length', length(v_doc_fin));
utl_http.write_text(req, v_doc_fin);
res := utl_http.get_response(req);
end if;
我尝试使用write_raw和write_text来提出HTTP请求,但都没有帮助。
UTL_HTTP.write_text (req, v_doc_fin) ;
UTL_HTTP.WRITE_RAW (r => req, data => UTL_RAW.CAST_TO_RAW(v_doc_fin));
我也尝试在块中打破请求主体,但也无济于事。
30000个字符限制内的请求正常工作,但是当它们超过该限制时,它会失败。
请建议或建议发送此请求主体,并在Oracle 12c中使用如此大量的数据。
如果您在数据库中安装了APEX,则可以使用Apex_web_service.make_rest_request使用APEX_WEB_SERVICE.MAKE_REST_REQUEST。它发送并接收clob数据。
https://docs.oracle.com/database/121/aeapi/aeapi/apex_web_service.htm#aeapi537
示例
l_result_clob := apex_web_service.make_rest_request(p_url => my_url
,p_http_method => 'POST'
,p_body => l_content_clob);