Very Useful
Shripad, January 22, 2020 - 9:41 am UTC
This was very useful. We can get the response in chunks.
Could not find this in any documentation.
This saved my life :)
Gnanam, February 18, 2021 - 1:36 pm UTC
its very helpful
February 18, 2021 - 6:03 pm UTC
Great to hear :)
Similar approach with JSON response but have number in middle of response
Neel Shah, June 10, 2022 - 8:34 pm UTC
Hello , I am using similar approach to the response greater than 32K below is the snippet of my code
I am not able to parse the chunked response , I see in json response number added in the middle of response .
Please Suggest.
IF (resp_6.STATUS_CODE = UTL_HTTP.HTTP_OK) THEN
DBMS_OUTPUT.PUT_LINE('Response Headers:-');
DBMS_LOB.CREATETEMPORARY(buffer_6, FALSE);
BEGIN
LOOP
UTL_HTTP.READ_TEXT(resp_6, resp_content_6, 32000);
IF (resp_count_header_6 = 0) THEN
-- DBMS_OUTPUT.PUT_LINE(SUBSTR(resp_content_6, 1, (INSTR(resp_content_6,'{')-2)));
resp_content_6 := SUBSTR(resp_content_6, (INSTR(resp_content_6,'{')-1));
resp_count_header_6 := resp_count_header_6 + 1;
END IF;
DBMS_LOB.WRITEAPPEND(buffer_6, LENGTH(resp_content_6), resp_content_6);
-- DBMS_OUTPUT.PUT_LINE(resp_content_6);
-- UTL_HTTP.READ_LINE(resp_6, buffer_6);
-- DBMS_OUTPUT.PUT_LINE(buffer_6);
END LOOP;
EXCEPTION
WHEN UTL_HTTP.END_OF_BODY THEN
UTL_HTTP.CLOSE_PERSISTENT_CONNS;
UTL_HTTP.END_RESPONSE(resp_6);
WHEN UTL_HTTP.TOO_MANY_REQUESTS THEN
UTL_HTTP.CLOSE_PERSISTENT_CONNS;
UTL_HTTP.END_RESPONSE(resp_6);
END;
apex_json.parse(buffer_6);
June 13, 2022 - 8:42 am UTC
Not sure why you need the hunting for brackets etc, because we are just combining into a lob. New lines etc are not needed