DECLARE
req utl_http.req;
resp utl_http.resp;
VALUE VARCHAR2(4000);
BEGIN
req := utl_http.begin_request('www.baidu.com');
utl_http.set_header(req, 'Content-Type', 'text/html; charset=gb2312');
resp := utl_http.get_response(req);
dbms_output.enable(1000000);
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;
oracle数据库测试http请求访问某个地址是否正常
最新推荐文章于 2025-03-12 16:50:09 发布