PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Sends a REST request and waits for the server response.
Versions 22 and later
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications.
WEBDEV - Browser code This function is now available in browser code.
New in version 22
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications.
WEBDEV - Browser code This function is now available in browser code.
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications.
WEBDEV - Browser code This function is now available in browser code.
Example
cMyRequest is restRequest
cMyRequest..URL = "<server address>"
cMyResponse is restResponse = RESTSend(cMyRequest)
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 = RESTSend(cMyRequest)
IF ErrorOccurred THEN
Error(ErrorInfo(errFullDetails))
ELSE
IF cMyResponse..Content = True THEN
Info("The site was updated.")
ELSE
Error(cMyResponse..Content)
END
END
Syntax

Syntax that is using a restRequest variable Hide the details

<REST Response> = RESTSend(<REST Request>)
<REST Response>: restResponse variable
Name of restResponse variable containing the response received from the REST server.
<REST Request>: restResponse variable
Name of restRequest variable containing the characteristics of the REST request that will be sent to the server.

Simplified syntax for sending a request Hide the details

<REST Response> = RESTSend(<URL>)
<REST Response>: restResponse variable
Name of restResponse variable containing the response received from the REST server.
<URL>: Character string (with quotes)
URL to interrogate.
Versions 22 and later
WEBDEV - Browser code

Asynchronous syntax that is using a restRequest variable Hide the details

RESTSend(<HTTP Request> , <WLanguage Procedure>)
<HTTP Request>: httpRequest variable
Name of restRequest variable containing the characteristics of the REST request that will be sent to the server.
<WLanguage Procedure>: Character string
Name of WLanguage procedure called during the response from the REST server. This procedure has the following format:
PROCEDURE <Procedure Name>(<Response> is restResponse)
where <Response> is a restResponse variable containing the response received from the REST server.
New in version 22
WEBDEV - Browser code

Asynchronous syntax that is using a restRequest variable Hide the details

RESTSend(<HTTP Request> , <WLanguage Procedure>)
<HTTP Request>: httpRequest variable
Name of restRequest variable containing the characteristics of the REST request that will be sent to the server.
<WLanguage Procedure>: Character string
Name of WLanguage procedure called during the response from the REST server. This procedure has the following format:
PROCEDURE <Procedure Name>(<Response> is restResponse)
where <Response> is a restResponse variable containing the response received from the REST server.
WEBDEV - Browser code

Asynchronous syntax that is using a restRequest variable Hide the details

RESTSend(<HTTP Request> , <WLanguage Procedure>)
<HTTP Request>: httpRequest variable
Name of restRequest variable containing the characteristics of the REST request that will be sent to the server.
<WLanguage Procedure>: Character string
Name of WLanguage procedure called during the response from the REST server. This procedure has the following format:
PROCEDURE <Procedure Name>(<Response> is restResponse)
where <Response> is a restResponse variable containing the response received from the REST server.
Versions 22 and later
WEBDEV - Browser code

Simplified asynchronous syntax for sending a request Hide the details

HTTPSend(<URL> , <WLanguage Procedure>)
<URL>: Character string (with quotes)
URL to interrogate.
<WLanguage Procedure>: Character string
Name of WLanguage procedure called during the response from the REST server. This procedure has the following format:
PROCEDURE <Procedure Name>(<Response> is restResponse)
where <Response> is a restResponse variable containing the response received from the REST server.
New in version 22
WEBDEV - Browser code

Simplified asynchronous syntax for sending a request Hide the details

HTTPSend(<URL> , <WLanguage Procedure>)
<URL>: Character string (with quotes)
URL to interrogate.
<WLanguage Procedure>: Character string
Name of WLanguage procedure called during the response from the REST server. This procedure has the following format:
PROCEDURE <Procedure Name>(<Response> is restResponse)
where <Response> is a restResponse variable containing the response received from the REST server.
WEBDEV - Browser code

Simplified asynchronous syntax for sending a request Hide the details

HTTPSend(<URL> , <WLanguage Procedure>)
<URL>: Character string (with quotes)
URL to interrogate.
<WLanguage Procedure>: Character string
Name of WLanguage procedure called during the response from the REST server. This procedure has the following format:
PROCEDURE <Procedure Name>(<Response> is restResponse)
where <Response> is a restResponse variable containing the response received from the REST server.
Remarks
  • WindowsLinuxAndroidAndroid Widget iPhone/iPad To find out the runtime errors of this function, use ErrorOccurred and ErrorInfo.
  • AndroidAndroid Widget This function is available for the devices equipped with ARM processors only. A fatal error will occur if this function is used with devices not equipped with ARM processors (x86, mips, ...).
Components
WINDEVWEBDEV - Server codeReports and Queries wd230com.dll
WEBDEV - Browser code WDJS.DLL
Linux wd230com.so
Android wd230android.jar
Minimum required version
  • Version 20
This page is also available for…
Comments
Click [Add] to post a comment