Hi everyone , I have the following code , I'm using Oracle 11g Database
declare
l_req UTL_HTTP.REQ;
l_resp UTL_HTTP.RESP;
buffer varchar2(4000);
BEGIN
-- UTL_HTTP.END_RESPONSE(l_resp);
l_req := utl_http.begin_request(
url => 'http://10.50.32.210:8000/api/public_things/',
method => 'GET'
);
l_resp := utl_http.get_response(r => l_req);
dbms_output.put_line(l_resp.ITEM_CODIGO);
loop
utl_http.read_line(l_resp, buffer);
dbms_output.put_line(buffer);
end loop;
utl_http.end_response(r => l_resp);
EXCEPTION
when utl_http.end_of_body then
utl_http.end_response(l_resp);
DBMS_OUTPUT.PUT_LINE('ok');
WHEN OTHERS THEN
utl_http.end_response(l_resp);
DBMS_OUTPUT.PUT_LINE('error');
END;
this code work fine , and the response is :
[{"ITEM_COD":"V0462723","ITEM_CLIENTE":"54","ITEM_TIPO":"DB","ITEM_ALTERNO":null,"ITEM_CODIGOUBICACION":null,"ITEM_PADRE":"S22995","ITEM_FECHA":"2011-10-21T23:53:07.000Z"},
{"ITEM_COD":"DBV","ITEM_CLIENTE":"43","ITEM_TIPO":"DB","ITEM_ALTERNO":null,"ITEM_CODIGOUBICACION":null,"ITEM_PADRE":"22995","ITEM_FECHA":"2011-10-21T23:53:07.000Z"}]
The question is , How I can access to ITEM CLIENTE or other json property key and get value in this response with pl/sql , anyone have any idea ?