Á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

@Get("/test/helloWorld")
User Function helloWorld()
   Local cReturn := "Meu primeiro REST em TL++ "
   oRest:setResponse(cReturn)
Return nil

Utilizando classe

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

class helloWorld
 public data cReturn

 public method new()
 
 @Get("/test/helloWorld")
 public method sayHello()
endClass

method new() class helloWorld
  ::cReturn := "Meu primeiro REST em TL++ "
return self

method sayHello() class helloWorld
 oRest:setResponse(::cReturn)
return .T.

Explicando os componentes

...