Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Create Simple http Post Request

869209Jun 15 2011 — edited Jun 16 2011
Hi

Ok I need to create fairly simple http post from Database (linux) to another Linux box.

Here is what My whole program structured :

I create Flat files from given table(oracle 10.2.0.3) on periodic basis
Zip and FTP them over the network to another Linux (X86_64) box. THis doesnt have Database Its more of just webserver
Once I push FTP file I need to do HTTP POST telling this webserver that files are being pushed as

url = https://xxx.xx.xx.xx/file/upload

data = file123.zip&[file1||file2||file3]=3

I have done same this in Sql server and it seems its quite straight forward once u know how to to it. How can I accomplish same in Oracle 10g.

This is what preetty much summed my code in sql server :


exec @hr = sp_OACreate 'MSXML2.ServerXMLHttp', @httpRequest OUT

exec @hr = sp_OAMethod @httpRequest, 'open', NULL, 'POST', @sUrl, false

exec @hr = sp_OAMethod @httpRequest, 'setRequestHeader', NULL, 'Content-Type', 'application/x-www-form-urlencoded'

set @requestBody = 'file123.zip&[file1||file2||file3]=3'

exec @hr = sp_OAMethod @httpRequest, 'setOption', NULL, 2, 13056

exec @hr = sp_OAMethod @httpRequest, send, NULL, @requestBody

exec @hr = sp_OAGetProperty @httpRequest, 'status', @status OUT
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 14 2011
Added on Jun 15 2011
4 comments
2,539 views