Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This server class

Tip

Change the REST_message_record text from the examples below to the record name of your REST message.

execute()

Sends the REST message.


Return:

TypeDescription
SimpleRestResponseResponse to the message sent by the execute() method.


Example:

Code Block
languagejs
themeEclipse
titleexecute
var sm = new sn_ws.SimpleRestRequestApi(“REST_message_record”, “get”);
var response = sm.execute();


setBasicAuth(userName, userPass)

Sets the username for web-service auth if the basic auth type was chosen. Method description


Parameter(s):

NameTypeMandatoryDefault Value
userNameStringYN
userPassStringYN


Return:

TypeDescription



Example:

Code Block
languagejs
themeEclipse
titlesetBasicAuth
var sm = new sn_ws.SimpleRestRequestApi(“REST_message_record”, “get”);
sm.setBasicAuth(“username”, “password”);


setRequestUrl(requestUrl)

Sets the request URL.Method description


Parameter(s):

NameTypeMandatoryDefault Value
requestUrlStringYN


Return:

TypeDescription



Example:

Code Block
languagejs
themeEclipse
titlesetRequestUrl
var sm = new sn_ws.SimpleRestRequestApi(“REST_message_record”, “get”);
sm.setRequestUrl(“url”);


setRequestMethod(methodName)

Sets the requesting method (GET, POST, PURGE, etc). Accepts the requesting method name.Method description


Parameter(s):

NameTypeMandatoryDefault Value
methodNameStringYN


Return:

TypeDescription



Example:

Code Block
languagejs
themeEclipse
titlesetRequestMethod
var sm = new sn_ws . SimpleRestRequestApi(“REST_message_record”, “get”);
sm.setRequestMethod(“get”);



Method description


Parameter(s):

NameTypeMandatoryDefault Value





Return:

TypeDescription



Example:

Code Block




Method description


Parameter(s):

NameTypeMandatoryDefault Value





Return:

TypeDescription



Example:

Code Block


Table of Contents
absoluteUrltrue
classfixedPosition