Á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 u_helloWorld()
 Local cReturn := "Meu primeiro REST em TL++ " as character
 oRest:setResponse(cReturn)
Return .T.

...

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

class helloWorld
 public data cReturn as character

 public method new()

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

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

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

...

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

As includes tlpp-core.th e tlpp-rest.th são as únicas bibliotecas necessárias para o funcionamento básico que qualquer função\classe REST.

...