Hi,
I have the following basic code which i use to post a plsql json request. Each time i execute the SQL,DBMS ouput '{"err":{"type":"empty_signature","message":"empty signature"}}'. Where is it that i am going wrong?
Thanks!
DECLARE
req utl_http.req;
res utl_http.resp;
v_url VARCHAR2(4000) := 'http://192.168.210.7:8080';
v_buffer VARCHAR2(4000);
v_timestamp VARCHAR2(20);
v_signature VARCHAR2(50):='ea1fc49de2c72b9dc377aaa79553e7ed';
v_content VARCHAR2(4000);
BEGIN
SELECT to_char(SYSDATE, 'yyyymmddhh24miss') INTO v_timestamp FROM dual;
v_content := '{"signature":"' || v_signature || '","timestamp":"' || v_timestamp || '","infos":{"test_no": "test1"}}';
req := utl_http.begin_request(v_url, 'POST', 'HTTP/1.1');
utl_http.set_header(req, 'Content-Type', 'application/json');
utl_http.set_header(req, 'Content-Length', length(v_content));
utl_http.write_text(req, v_content);
dbms_output.put_line(v_content);
res := utl_http.get_response(req);
BEGIN
LOOP
utl_http.read_line(res, v_buffer);
dbms_output.put_line(v_buffer);
END LOOP;
utl_http.end_response(res);
EXCEPTION
WHEN utl_http.end_of_body THEN
utl_http.end_response(res);
END;
END;