Hi There,
First of all, I am using the UTL_HTTP package for the first time. Basically, we have to POST JSON data to a URL. The format of the data is
{"definition":"Part","item":"Part1","value":"123"}
{"definition":"Part","item":"Part2","value":"789"}
...
{"definition":"Part","item":"Partn","value":"345"}
Now using the Curl command we can run the comand
$ curl -X POST http://xyz.com/test -H 'Content-Type: application/json' -d '{"items":[
{"definition":"Part","item":"Part1","value":"123"}
{"definition":"Part","item":"Part2","value":"789"}
...
{"definition":"Part","item":"Partn","value":"345"}
The same needs to be implemented in PL/SQL, I found this link
http://technology.amis.nl/2012/01/19/publishing-to-cometd-bayeux-channel-from-inside-the-oracle-database-plsql-based-push-to-cometd-web-client/
I was getting the error
Error report:
ORA-29273: HTTP request failed
ORA-06512: at "SYS.UTL_HTTP", line 1130
ORA-29261: bad argument
ORA-06512: at line 61
29273. 00000 - "HTTP request failed"
*Cause: The UTL_HTTP package failed to execute the HTTP request.
*Action: Use get_detailed_sqlerrm to check the detailed error message.
Fix the error and retry the HTTP request.
This was after I tried changing the POST procedure to a anonymoust block and tried to run it since we do not have create rights on the DB. Before I post the change, just wanted to check if anyone has any suggestions on impementing this in PL/SQL, basically, we just need to send 2 columns data in JSON format to a URL on a daily basis.
Thanks