I have Oracle 18c database with Apex 19.2.
I created an ORDS RESTful Service to receive some POST requests from another application.
I need to get some detailed informations about the request sent to my RESTful service.
So I'm using the implicit parameters documented here:
For example : :body, :content_type...
declare
RequestBodyReceived blob;
begin
RequestBodyReceived := :body ;
insert into SomeTable (RequestBody) values (RequestBodyReceived);
:status_code := 201;
end;
This is nice but I can't find other informations about the request. Mainly the sender host, the headers, etc.
How can I get sender Host and Request headers?
Use the following code as an endpoint source to check all available CGI variables.
begin
for i in 1..nvl(owa.num_cgi_vars, 0) loop
htp.p(owa.cgi_var_name(i) || ': ' || owa.cgi_var_val(i));
end loop;
end;
I found it some time ago on the Internet, but I don't remember where was it.