oracle http请求 时报错
请问是什么原因?该怎么解决?
在百度ora-12541的时候,发现大多都是登录出现问题。
function 代码如下
FUNCTION post_json(p_url IN VARCHAR2 ,p_data IN VARCHAR2) RETURN VARCHAR2 IS http_req utl_http.req; http_resp utl_http.resp; lv_result VARCHAR2(1024); lv_data VARCHAR2(32767); lv_data_length NUMBER; BEGIN lv_data := p_data; lv_data_length := lengthb(lv_data); http_req := utl_http.begin_request(p_url, 'POST'); utl_http.set_body_charset('UTF-8'); utl_http.set_header(http_req, 'Content-Type', 'application/json;charset=UTF-8'); utl_http.set_header(http_req, 'Content-Length', lv_data_length); utl_http.write_raw(http_req, utl_raw.cast_to_raw(lv_data)); http_resp := utl_http.get_response(http_req); utl_http.read_line(http_resp, lv_result, TRUE); utl_http.end_response(http_resp); RETURN lv_result; /* EXCEPTION WHEN utl_http.end_of_body THEN utl_http.end_response(http_resp); RETURN lv_result; WHEN OTHERS THEN --utl_http.end_response(http_resp); RETURN '0' || '@失败'; */ END;