Versions Compared
compared with
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.
Name | Type | Mandatory | Default Value |
---|---|---|---|
response | Response | Y | N |
Return:
Type | Description |
---|---|
Void | This method does not return a value. |
Example:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
var sm = sws.SimpleRestResponse(response); |
getBody()
This method returns the response body.
Return:
Type | Description |
---|---|
String | The response body. |
Example:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
var sm = sws.SimpleRestResponse(response); var body = sm.getBody(); |
getAllHeaders()
This method returns the array containing response headers.
Return:
Type | Description |
---|---|
Array | Response headers. |
Example:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
var sm = sws.SimpleRestResponse(response); var headers = sm.getAllHeaders(); |
getStatusCode()
Returns the HTTP status code.
Return:
Type | Description |
---|---|
String | HTTP status code. |
Example:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
var sm = sws.SimpleRestResponse(response); var status = sm.getStatusCode(); |
haveError()
This method displays if there was an error during the REST transaction.
Return:
Type | Description |
---|---|
Boolean | The error notification. |
Example:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
var sm = sws.SimpleRestResponse(response); var error = sm.getHaveErrorhaveError(); |
Table of Contents | ||||
---|---|---|---|---|
|