Oracle UTL_HTTP POST encoding multipart/form-data

丶灬走出姿态 提交于 2019-12-11 03:16:07

问题


I would like to do a POST from PL/SQL, using as enctype "Multipart/form-data" in order to post a document contained in a LONG RAW to a servlet. This would simulate a typical "FILE UPLOAD" as if done by a browser.

I was wondering if there is any example on how to do it..

I think something like that could work .. but a working example would be very much appreciated

document long raw;
env VARCHAR2(32767);
mytable record of varchar2(32767);
http_req utl_http.req;
BEGIN
http_req:=utl_http.begin_request(url,'POST');
utl_http.set_header(http_req,'Content-Type','multipart/form-data');
...
mytable:=longraw_to_hex(document)
foreach line in mytable
utl_http.write_text(http_req,chunk)
..
END

来源:https://stackoverflow.com/questions/23925278/oracle-utl-http-post-encoding-multipart-form-data

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!