You are viewing an old version of this page. View the current version.
Compare with Current View Page History
« Previous Version 7 Next »
This server class
Change the REST_message_record text from the examples below to the record name of your REST message.
Sends the REST message.
Return:
Example:
var sm = new sn_ws.SimpleRestRequestApi(“REST_message_record”, “get”); var response = sm.execute();
Sets the username for web-service auth if the basic auth type was chosen.
Parameter(s):
var sm = new sn_ws.SimpleRestRequestApi(“REST_message_record”, “get”); sm.setBasicAuth(“username”, “password”);
Sets the request URL.
var sm = new sn_ws.SimpleRestRequestApi(“REST_message_record”, “get”); sm.setRequestUrl(“url”);
Sets the requesting method (GET, POST, PURGE, etc). Accepts the requesting method name.
var sm = new sn_ws . SimpleRestRequestApi(“REST_message_record”, “get”); sm.setRequestMethod(“get”);
Sets the response timeout until the request is out of time.
var sm = new sn_ws . SimpleRestRequestApi(“REST_message_record”, “get”); sm.setRequestTimeout(“60000”);
Adds a parameter into the end of the URL request formed as a "name=value",
var sm = new sn_ws . SimpleRestRequestApi(“REST_message_record”, “get”); sm.setQueryParameter(“sysparm_query”, “active=true^ORDERBYDESCcategory”);
Sets the request body when used PUT or POST methods.
var sm = new sn_ws . SimpleRestRequestApi(“REST_message_record”, “get”); var body = “<Message body content>”; sm.setRequestBody(body);
Method description