Versions Compared

Key

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

This server class allows operating with REST responses.

SimpleRestResponseApi(response)


Initialises an empty SimpleRestResponseApi object.

NameTypeMandatoryDefault Value
responseResponseYN


Return:

TypeDescription
VoidThis method does not return a value.


Example:

Code Block
languagejs
themeEclipse
titleSimpleRestResponseApi
var sm = sws.SimpleRestResponseApi(response);


getBody()


This method returns the response body.


Return:

TypeDescription
StringThe response body.


Example:

Code Block
languagejs
themeEclipse
titlegetBody
var sm = sws.SimpleRestResponseApi(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.SimpleRestResponseApi(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.SimpleRestResponseApi(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.SimpleRestResponceApi(response);
var error = sm.getHaveError();


Table of Contents
absoluteUrltrue
classfixedPosition