|
|
|
|
Envía una solicitud de REST y espera la respuesta del servidor. cMyRequest is restRequest cMyRequest.URL = "<server address>" cMyResponse is restResponse = cMyRequest.Send() IF ErrorOccurred THEN Error(ErrorInfo(errFullDetails)) ELSE Info(cMyResponse.Content) END // The code sample below explains how to call a WINDEV REST Webservice with parameters. // The procedure found in the Webservice has the following format: // PRIVATE PROCEDURE UpdateTopBar(bTestMode is boolean) // The test URL has the following format: // http://<Server IP>/<Common component> //?test // WLanguage code used to call it by passing the parameter cMyRequest is restRequest cMyRequest.Method = httpGet cMyRequest.URL = "http://<Server IP>/CDM/UpdateTopBar/1" //Where CDM is the common component and 1 the parameter value cMyResponse is restResponse = cMyRequest.Send() IF ErrorOccurred THEN Error(ErrorInfo(errFullDetails)) ELSE IF cMyResponse.Content = True THEN Info("The site was updated.") ELSE Error(cMyResponse.Content) END END Sintaxis
Sintaxis sincrónica: espere la respuesta Ocultar los detalles
<REST response> = <REST request>.Sends()
<REST response>: restResponse Variable Nombre de restResponse Variable que contiene la respuesta recibida del servidor REST. <REST request>: restResponse Variable Nombre de la restRequest Variable que contiene las características de la solicitud REST que se enviará al servidor. Clasificación Lógica de negocio / UI: Lógica de negocio
Esta página también está disponible para…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|