Saturday 4 June 2016

APEX web service

POST request with no parameters

It may come handy one day


Ever needed to submit a POST request to your APEX web service while there were no parameters to send. 

This is a quick info to give you an idea where to start.
Of course first you create your POST Handler for APEX REST Service, please notice that there are no input parameters defined. 

And put this into PL/SQL source: 
declare
   l_clob clob;
   l_blob blob;  
begin
   l_blob := :body;
   l_clob := wwv_flow_utilities.blob_to_clob(l_blob);
  
   --parse JSON and get the data out
   logger.log(l_clob); --we all know logger package by Martin D'Souza right?
end;   

This is a cool way of testing what you get at your end before you start processing it with any logic. Hope it helps.

Thanks,
Lino

No comments:

Post a Comment