This issue seems like out would be simple fix by enabling CORS on the apex.oracle.com service, but there is something else going on.
Hitting my REST endpoints from Postman work just fine. DELETE and PUT (Update) included. However when I call them from my JavaScript application, I get the CORS error.
The SQL looks like this
ORDS.define_handler(
p_module_name => 'testmodule3',
p_pattern => '.',
p_method => 'DELETE',
p_source_type => ORDS.source_type_plsql,
p_source => 'BEGIN
remove_employee(p_empno => :empno);
END;',
p_items_per_page => 0);
and the stored procedure looks like:
create or replace PROCEDURE remove_employee (
p_empno IN emp.empno%TYPE
)
AS
BEGIN
DELETE FROM emp WHERE empno = p_empno;
EXCEPTION
WHEN OTHERS THEN
HTP.print(SQLERRM);
END;
Here is the full error message. The endpoint is in there if you want to try and hit it.
Failed to load https://apex.oracle.com/pls/apex/oraclejet/emp//553: Method DELETE is not allowed by Access-Control-Allow-Methods in preflight response.
If I had access to the server, I would check my servlet filters, but this is all from apex.oracle.com.
Thanks for any thoughts or pointers.
--jb