ONLINE
REPOSITORY
FOR
WINDEV
,
WEBDEV
AND
WINDEV MOBILE
Home
|
Profile
|
Sign in
|
English
Exemplo WINDEV Mobile como usar rest send e estruturas sem usar variáveis globais com estrutura na classe
Published by Boller
in the category Tools
New features
Description
WINDEV Mobile example how to use rest send and structures without using global variables with structure in class
TEM O PDF DA DOCUMENTACAO DENTRO DO ZIP
//EXEMPLO
URL is string = "https://api.dignustech.com.br/v1/partidas"
ENVIO is httpRequest
ENVIO.URL = URL
ENVIO.ContentType = mimeTypeJSON
ENVIO.Method = httpGet
RESPOSTA is httpResponse
RESPOSTA = RESTSend(ENVIO)
EDT_RESULTADO = RESPOSTA..Content
sRetJSON is Buffer = RESPOSTA..Content
Info(RESPOSTA..Content + CR + RESPOSTA..StatusCode)
//---------------------------------------------------------------------------------------- usando a classe
ClassWilli is a Class
m_Tabela is array of st_Tabela
END
st_totais is Structure
qtd is numeric
END
st_Tabela is Structure
id is numeric
data is string
hora is string
colete1 is string
colete2 is string
tempo is numeric
tempo1 is numeric
gol1_1 is numeric
gol2_1 is numeric
tempo2 is numeric
gol1_2 is numeric
gol2_2 is numeric
qrcode is string
status is string
END
//---------------------------------------------------- metodo
// Summary: <specify the procedure action>
// Syntax:
//[ <Result> = ] ExecutaRest (<URL>)
//
// Parameters:
// URL: <specify the role of URL>
// Example:
// <Specify a usage example>
//
// instancia:
// URL: <specify the role of URL>
// instancia: <specify the role of instancia>
PROCEDURE ExecutaRest(URL)
ENVIO is httpRequest
ENVIO.URL = URL
ENVIO.ContentType = mimeTypeJSON
ENVIO.Method = httpGet
RESPOSTA is httpResponse
RESPOSTA = RESTSend(ENVIO)
sRetJSON is JSON = RESPOSTA..Content
n is int = sRetJSON.qtd
i is int = 0
nAux1 is int = 0
LOOP(n)
i++
//info(sRetJSON.registros[i].id)
nAux1 = ArrayAdd(m_Tabela)
m_Tabela[nAux1].id = sRetJSON.registros[i].id
m_Tabela[nAux1].data = sRetJSON.registros[i].data
m_Tabela[nAux1].hora = sRetJSON.registros[i].hora
m_Tabela[nAux1].colete1 = sRetJSON.registros[i].colete1
m_Tabela[nAux1].colete2 = sRetJSON.registros[i].colete2
m_Tabela[nAux1].tempo = sRetJSON.registros[i].tempo
m_Tabela[nAux1].tempo1 = sRetJSON.registros[i].tempo1
m_Tabela[nAux1].gol1_1 = sRetJSON.registros[i].gol1_1
m_Tabela[nAux1].gol2_1 = sRetJSON.registros[i].gol2_1
m_Tabela[nAux1].tempo2 = sRetJSON.registros[i].tempo2
m_Tabela[nAux1].gol1_2 = sRetJSON.registros[i].gol1_2
m_Tabela[nAux1].gol2_2 = sRetJSON.registros[i].gol2_2
m_Tabela[nAux1].qrcode = sRetJSON.registros[i].qrcode
m_Tabela[nAux1].status = sRetJSON.registros[i].status
END
RESULT RESPOSTA..Content
//------------------------------- codigo no botao
executa01 is ClassWilli
EDT_RESULTADO = executa01.ExecutaRest("https://api.dignustech.com.br/v1/partidas")
//---------------------------------------------------------------
MORE
Illustrations, screen shots
User reviews
Write a review
Report abuse
(To evaluate this resource, click 'Write a review')
You must
be connected
to post a review
No review or comment? Be the first one!
ABOUT
RATING:
0
0
No rating
DOWNLOADS:
26
PUBLISHED:
February 17, 2024
VERSION:
29
CONCERNS:
WINDEV, WEBDEV, WINDEV Mobile
Minimum version: 29
SIZE:
4.2 MB
Download
OF SAME DEVELOPER
Porta Serial - Leitura e escrita em Porta Serial COM ou Paralela usando Maquina de Estado com Thread intermitente
(1)
LIB MYMSQL FREE - libmySQL.DLL - Biblioteca LIB do mySQL
(1)
Instalador do Driver Nativo do PostgreSQL no WINDEV e WEBDEV da Biblioteca LIBPQ.DLL - Biblioteca LIB do PostgreSQL para usar em
(6)
Classe Oop CLASSO = C Lasso (Seleção de objetos na tela = Componente WX OCR
(1)
See more...
Français
English
Close this window
https://www.windev.com