Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DECLARE
- req UTL_HTTP.req;
- res UTL_HTTP.resp;
- url VARCHAR2(4000) := 'http://apiinspector.multeo.net/auth';
- buffer VARCHAR2(4000);
- body_content VARCHAR2(4000) := '{"grant_type":"admin", "client_id": "multeo", "client_secret": "Kww9ZcyQVyvQXyCTeuhf769HULAR8nMJ", "document": "000001","password": "TD54A8aWdKgfbRGs"}';
- BEGIN
- DBMS_OUTPUT.put_line(LENGTH(content));
- req := UTL_HTTP.begin_request(url, 'POST',' HTTP/1.1');
- UTL_HTTP.set_header(req, 'user-agent', 'mozilla/4.0');
- UTL_HTTP.set_header(req, 'Accept', 'application/x.api.v1+json');
- UTL_HTTP.set_header(req, 'cache-control', 'no-cache');
- UTL_HTTP.set_header(req, 'Content-Type', 'application/json');
- DBMS_OUTPUT.put_line(LENGTH(body_content));
- UTL_HTTP.set_header(req, 'Content-Length', LENGTH(body_content));
- DBMS_OUTPUT.put_line(body_content);
- UTL_HTTP.write_text(req, body_content);
- res := UTL_HTTP.get_response(req);
- -- process the response from the HTTP call
- UTL_HTTP.read_line(res, buffer);
- DBMS_OUTPUT.put_line(buffer);
- /*
- begin
- loop
- utl_http.read_line(res, buffer);
- dbms_output.put_line(buffer);
- end loop;
- utl_http.end_response(res);
- exception
- when utl_http.end_of_body
- then
- utl_http.end_response(res);
- end;
- */
- END;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement