Versions Compared

Key

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

This server class allows operating with REST responses.

SimpleRestResponse(response)


Initialises an empty SimpleRestResponse object.

NameTypeMandatoryDefault Value
responseResponseYN


Return:

TypeDescription
VoidThis method does not return a value.


Example:

Code Block
languagejs
themeEclipse
titleSimpleRestResponse
var sm = sws.SimpleRestResponse(response);


getBody()


This method returns the response body.


Return:

TypeDescription
StringThe response body.


Example:

Code Block
languagejs
themeEclipse
titlegetBody
var sm = sws.SimpleRestResponse(response);
var body = sm.getBody();


getAllHeaders()


This method returns the array containing response headers.


Return:

TypeDescription
ArrayResponse headers.


Example:

Code Block
languagejs
themeEclipse
titlegetAllHeaders
var sm = sws.SimpleRestResponse(response);
var headers = sm.getAllHeaders();


getStatusCode()


Returns the HTTP status code.


Return:

TypeDescription
StringHTTP status code.


Example:

Code Block
languagejs
themeEclipse
titlegetStatusCode
var sm = sws.SimpleRestResponse(response);
var status = sm.getStatusCode();


haveError()


This method displays if there was an error during the REST transaction.


Return:

TypeDescription
BooleanThe error notification.


Example:

Code Block
languagejs
themeEclipse
titlehaveError
var sm = sws.SimpleRestResponceApiSimpleRestResponse(response);
var error = sm.getHaveError();


Table of Contents
absoluteUrltrue
classfixedPosition