|
|
|
|
<restRequest variable>.Send (Function) In french: <Variable restRequête>.Envoie Sends a REST request and waits for the server response. cMyRequest is httpRequest cMyRequest.URL = "<server address>" cMyResponse is httpResponse = 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 httpRequest cMyRequest.Method = httpGet cMyRequest.URL = "http://<Server IP>/CDM/UpdateTopBar/1" //Where CDM is the common component and 1 the parameter value cMyResponse is httpResponse = 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 Syntax
Synchronous syntax: wait for the reply Hide the details
<REST response> = <REST request>.Sends()
<REST response>: restResponse variable Name of restResponse variable containing the response received from the REST server. <REST request>: restResponse variable Name of the restRequest variable that contains the characteristics of the REST request to be sent to the server. Business / UI classification: Business Logic
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|