3 Replies Latest reply on Jul 4, 2011 11:57 AM by mwrf

    Resource Templates : need to return json response from POST, PUT and DELETE

    mwrf
      Hi,

      I'm writing an application that requires that {success:true] is returned from POST, PUT and DELETE requests
      in the response body.
      The client side framework I'm using does not read the HTTP status codes.

      I know that I can return anything in the header but this won't work for me, I need to respond with JSON.
      I have tried the following,

      Handler for DELETE:
      Type = PL/SQL Block

      begin
      delete from debug
      where test =
      ;
      select 'true' success from dual;
      end;
      
      AND
      
      Handler for DELETE:
      Type = Query
      
      begin
      delete from debug
      where test = 
      ;
      select 'true' success from dual;
      end;


      Both throw 500 errors. Is there anything I can do here to get this to work?

      Thanks in advance,

      Edited by: mwrf on Feb 14, 2011 2:00 AM

      Edited by: mwrf on Feb 14, 2011 2:01 AM