PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Pre-launched sessions
  • Passing parameters in the rough data of request (POST or PUT method)
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
WebserviceParameter (Function)
In french: WebserviceParamètre
AjaxNot available
Used to retrieve the value of a parameter during the call to a Webservice request.
Notes:
  • The parameters can be passed to a REST Webservice according to 2 methods:
    • Passing in the URL (URL such as "http://....?Param1=value1&Param2=value2..."). To retrieve the parameter value, use the syntax 1 or 2.
    • Passing in the rough data of request (POST or PUT method). To retrieve the parameter value, use the syntax 3.
  • This information is only available during the call to a function of a REST Webservice.
Example
// REST Webservice: retrieves the list of customers
// with an optional filter on the state.
// GET + /Customers[?state=xxx]
 
sState is string
 
// Use the syntax 1
sState = WebserviceParameter("state")
 
// Use the syntax 2
// sState = WebserviceParameter(1)
 
IF sState <> "" THEN
HFilter(Customer, State, sState)
END
// REST Webservice: retrieves the list of customers
// according to the filters specified in POST in JSON.
// POST + /Customers
 
sCustomerFilter is string
vParameters is Variant
 
// Retrieves the parameter value according to syntax 3
sCustomerFilter = WebserviceParameter(paramBuffer)
 
// Convert the parameter value in a Variant
// to study the content
vParameters = JSONToVariant(sCustomerFilter)
Syntax

Retrieving the value of a parameter identified by its name (REST Webservice only) Hide the details

<Parameter value> = WebserviceParameter(<Parameter name> [, <Encoding>])
<Parameter value>: Character string
Corresponds to:
  • Value of specified parameter.
  • Empty string ("") if the parameter does not exist or if it has no value.
<Parameter name>: Character string (with quotes)
Name of parameter whose value will be returned.
<Encoding>: Optional Integer constant
Mode for managing the encoding of parameter value:
paramWithDecoding
(Default value)
The parameter value is automatically decoded by WEBDEV according to the encoding/decoding standard of URLs.
paramNoDecodingThe rough parameter value is returned. No decoding is performed by WEBDEV. This constant can be used when the URL encoding does not respect the standard used by WEBDEV (problem for managing the + sign, etc.)

Retrieving the value of a parameter identified by its subscript (REST Webservice only) Hide the details

<Parameter value> = WebserviceParameter(<Parameter subscript> [, <Encoding>])
<Parameter value>: Character string
Corresponds to:
  • Value of specified parameter. This value has the following format: <Parameter name> = <Value>.
  • Empty string ("") if the parameter does not exist.
<Parameter subscript>: Integer
Subscript of parameter whose value will be returned.
<Encoding>: Optional Integer constant
Mode for managing the encoding of parameter value:
paramWithDecoding
(Default value)
The parameter value is automatically decoded by WEBDEV according to the encoding/decoding standard of URLs.
paramNoDecodingThe rough parameter value is returned. No decoding is performed by WEBDEV. This constant can be used when the URL encoding does not respect the standard used by WEBDEV (problem for managing the + sign, etc.)

Retrieving specific data (rough data of request sent by a POST or PUT method.) Hide the details

<Result> = WebserviceParameter(<Type of message>)
<Result>: Buffer
Valeur of requested message type:
  • Data received.
  • Empty buffer if no data.
<Type of message>: Integer constant
Type of data to retrieve:
paramBufferRetrieves the rough data that was received (sent by POST or PUT methods).
Remarks

Pre-launched sessions

If your project uses pre-launched sessions, this function must not be used in the event "Initializing" of the project. This function must only be used in the event "Initializing the project after connection to the site".

Passing parameters in the rough data of request (POST or PUT method)

To transmit parameters in the rough data of request (POST or PUT method) from a WINDEV or WEBDEV application, you have the ability to use the ..Content property of a restRequest variable.
Component : wd240awws.dll
Minimum version required
  • Version 22
This page is also available for…
Comments
Click [Add] to post a comment