Árvore de páginas

Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.

...

#include "tlpp-core.th"
#include "tlpp-rest.th"

Class classDeleteExamples

   Public Method New()

   @Delete("examples/class/delete/path/user/:user")
   Public Method methodExamplesDeletePath()

   @Delete("examples/class/delete/query/user")
   Public Method methodExamplesDeleteQuery()

EndClass

Method New() class classDeleteExamples

Return self

/* --------------------------------------------- */
@Delete("examples/class/delete/path/user/:user")
Method methodExamplesDeletePath() class classDeleteExamples

   Local cJson := ""
   Local jPath

   jPath := JsonObject():New()
   jPath := oRest:getPathParamsRequest()

   If (jPath <> Nil)
       cJson := '[ {"description": "methodExamplesDeletePath successfully executed, parameter received: ' + jPath['user'] + '"} ]'
   Endif
Return oRest:setResponse(cJson)

/* --------------------------------------------- */
@Delete("examples/class/delete/query/user")
Method methodExamplesDeleteQuery() class classDeleteExamples
   Local cJson := ""
   Local jQuery

   jQuery := JsonObject():New()
   jQuery := oRest:getQueryRequest()

   If (jQuery <> Nil)
       cJson := '[ {"description": "methodExamplesDeleteQuery successfully executed, parameter received: ' + jQuery['user'] + '"} ]'
   Endif
Return oRest:setResponse(cJson)