oracle utl_http的使用
最近要通过存储过程给web页面发送一个请求,网上看了下utl_http可以用,看了一下utl_http包中的例子如下:
DECLARE
req utl_http.req;
resp utl_http.resp;
value VARCHAR2(1024);
BEGIN
utl_http.set_proxy('proxy.it.my-company.com', 'my-company.com');
req := utl_http.begin_request('http://www-hr.corp.my-company.com');
utl_http.set_header(req, 'User-Agent', 'Mozilla/4.0');
resp := utl_http.get_response(req);
LOOP
utl_http.read_line(resp, value, TRUE);
dbms_output.put_line(value);
END LOOP;
utl_http.end_response(resp);
EXCEPTION
WHEN utl_http.end_of_body THEN
utl_http.end_response(resp);
END;
挪用下来运行了一下,直接死掉了,对这个很不懂,那位大侠帮忙一下,
还有执行了一下select utl_http.request('http://www.google.com.hk/') from dual;有记录返回,但是换成我们自己开发的url(没有发布)就报如下错,这是为什么呐
ORA-29273: HTTP 请求失败
ORA-06512: 在 "SYS.UTL_HTTP", line 1722
ORA-24247: 网络访问被访问控制列表 (ACL) 拒绝
ORA-06512: 在 line 1