I'm trying to create a RESTFUll API endpoint with ORACLE APEX using the PUT method (UPDATE) where i need to update the value of a column in a specific row, but when i try to test the method in POSTMAN it returns STATUS 555 USER DEFINED RESOURSE ERROR, and if i try to use the url directly into browser, it returns error 405 METHOD NOT ALLOWED. I'm trying this way:
Does anyone know why it`s not working correctly?
CodePudding user response:
Have you tested that pl/sql block ? I see 2 errors. That could explain the 555 error
BEGIN
update usu_int_foods
set email = :email -- missing equal sign
where cod_cracha = :id; -- missing semi colon
END;
In addition to that, what payload did you pass in POSTMAN ? Your code references a bind variable :email
but you do not references that anywhere or mention how you pass that value in the call.
Also, accessing a PUT rest endpoint in a browser will never work (more info here)
Best place to start with restful webservices is read Jeff Smith's very complete posts or Tim Hall's