-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCEP.PRW
33 lines (23 loc) · 916 Bytes
/
CEP.PRW
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#Include 'Protheus.ch'
#Include 'FWMVCDEF.ch'
#Include 'RestFul.CH'
/**************************
+-------------------------------------------------------------------------+
|Funcao | ConsLink | Autor | Walter Rodrigo |
+------------+------------------------------------------------------------+
|Data | 08.02.2021 |
+------------+------------------------------------------------------------+
|Descricao | Retorna a consulta dos dados do link criado |
**************************/
User Function ConsLink()
Local oRest := FWRest():New("https://rickandmortyapi.com")
Local oJson := JSonObject():New()
oRest:setPath("/api/character/1")
oRest:GET()
cResult := oRest:GetResult()
cErro := oJSon:fromJson(oRest:GetLastError())
If !empty(cErro)
Return aLink
Endif
aResult := oJson:GetJSonObject()
Return