Created
October 26, 2017 13:03
-
-
Save vitorebatista/9f18675603b33e411570ac243bfd7cb5 to your computer and use it in GitHub Desktop.
Exemplo webservice REST ADVPL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "PROTHEUS.ch" | |
#include "RESTFUL.ch" | |
#xtranslate @{Header <(cName)>} => ::GetHeader( <(cName)> ) | |
#xtranslate @{Param <n>} => ::aURLParms\[ <n> \] | |
#xtranslate @{EndRoute} => EndCase | |
#xtranslate @{Route} => Do Case | |
#xtranslate @{When <path>} => Case NGIsRoute( ::aURLParms, <path> ) | |
#xtranslate @{Default} => Otherwise | |
WsRestful tstwsrest Description "WebService REST para testes" | |
WsMethod GET Description "Sincronização de dados via GET" WsSyntax "/GET/{method}" | |
End WsRestful | |
WsMethod GET WsService tstwsrest | |
::SetContentType( 'application/json' ) | |
@{Route} | |
@{When '/users'} | |
::SetResponse('') | |
@{EndRoute} | |
Return .T. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment