Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Refresh page May 03, 2024 14:03

Supported Clients
SmartClient WebClient NGClient

Methods Summary
WsCookie createCookie(String, String) Create a http cookie.
WsRequest getRequest() Get the currently running REST-WS request.
WsResponse getResponse() Get the response for the currently running REST-WS request.
Boolean isRunningRequest() Check whether the client is currently running a REST-WS request.

Methods Details

createCookie(String, String)

Create a http cookie.
The cookie name and value allows only a sequence of non-special, non-white space characters, see
the cookie spec https://tools.ietf.org/html/rfc2965

Parameters

String
String

Returns

Supported Clients

SmartClient,WebClient,NGClient

Sample

var cookie = plugins.rest_ws.createCookie('chocolate', 'chip');
var response = plugins.rest_ws.getResponse();
response.addCookie(cookie);

getRequest()

Get the currently running REST-WS request.
 If the client is not currently running in REST-WS, an exception is thrown.

Returns

Supported Clients

SmartClient,WebClient,NGClient

Sample

 

getResponse()

Get the response for the currently running REST-WS request.
If the client is not currently running in REST-WS, an exception is thrown.

Returns

Supported Clients

SmartClient,WebClient,NGClient

Sample

var response = plugins.rest_ws.getResponse();
resp.setHeader("My-Custom-Header", "42");

isRunningRequest()

Check whether the client is currently running a REST-WS request.
 If false, the rest-ws client-plugin features are not available.

Returns

Supported Clients

SmartClient,WebClient,NGClient

Sample

 

  • No labels