![]() PROPERTIES AND METHODS OF RESTfulRESPONSESSO |
![]() Web Services |
![]() |
This SSO is a RESTfulObject that represents a RESTful HTTP response, implemented as a sub class of "RestfulObject". In addition to the header and body properties this object will have other properties relevant to an HTTP response. This SSO may be built from the response to a RESTful HTTP request or it may be built by PROIV logic and used to send a RESTful HTTP response. This object includes all the methods in the StructuredDataObject and the following methods:
-
clear(path) - This is the same as that for the SDO with a minor change. If the path refers to the object and not one of its properties (empty string or a single /) then this method clears all its properties except the header and the body objects. The header and body property objects are still there but now empty.
-
getCookie(name) - Returns the value of the named cookie as a string. If the cookie does not exist then the empty string is returned and last error is set.
-
getHdrParameter(name) - Returns the named property from the header as a string. If the property does not exist then the empty string is returned and last error is set.
-
getStatus() - Returns the HTTP status code as a string. If the response object is not the result of an HTTP request and the status has not been set by the setStatus method then the empty string is returned and last error is set.
-
setCookie(name, value, path) - Sets the value and the path of the named cookie as a string. If the path is null or the empty string then any existing path is left unchanged. If the cookie already exists then value is replaced by the new value. If the maxSizeInBytes property has been set and this addition would exceed the setting then the last error is set, and the value not set.
-
setHdrParameter(name, value) - Sets the named property in the header part of the object. If the property already exists then value is replaced by the new value. If the maxSizeInBytes property has been set and this addition would exceed the setting then the last error is set, and the value not set.
-
setStatus(statusCode) - Sets the HTTP status code that will be sent when this object is used to send an HTTP response. The status code is a string and should be one of the codes defined for the HTTP protocol. If the property already exists then value is replaced by the new value. If the maxSizeInBytes property has been set and this addition would exceed the setting then the last error is set, and the value not set.
-
useReport(boolean, path) - Takes a numeric parameter as a boolean (0 = false, anything else = true). If set to true then any report data in the task output is used as the response body and the body object is ignored. If the path is null then the report is the whole of the response body. If the property already exists then value is replaced by the new value. If the maxSizeInBytes property has been set and this addition would exceed the setting then the last error is set, and the value not set.
Basic examples of using the objects in PROIV Logic
-
$result = response.getJSON(Path)
-
response.Reference = request.send()
Topic ID: 400031