![]() PROPERTIES AND METHODS OF RESTfulREQUESTSSO |
![]() Web Services |
![]() |
RestfulRequestSSO represents a RESTful HTTP request, implemented as a sub class of "RestfulObject". This SSO can be built from an incoming RESTful HTTP request or it can be built by PROIV logic and used to send a RESTful HTTP request. In addition to the header and body properties this object has other properties relevant to an HTTP request.
This SSO has a collection of request parameters that have either been collected from an incoming HTTP request or set by the ‘set’ methods. These parameters are added to the URI when an HTTP request is sent. This object includes all the methods of the StructuredDataObject as well as 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.
getMappedString() - Returns the string that was used to identify this RESTful task for an incoming HTTP request. This string will be at the start of the URL path. If the request object is not the result of an HTTP request then the empty string is returned and last error is set.
getMethod() - Returns the HTTP request method set by an incoming HTTP request. If this object is not derived from an HTTP request and the setMethod has not been called then the returned value will be the empty string and last error is set.
getParameter(name) - Returns the named request query parameter as a string. If the property does not exist then the empty string is returned and last error is set.
getTimeout() - Returns the timeout (to be used when sending an HTTP request) as a number. If the property does not exist then the zero is returned and last error is set.
getURLPath() - Returns the URL path (the part after the hostname and port) for an incoming HTTP request. If the request object is not the result of an HTTP request then the empty string is returned and last error is set.
getURLPathArray() - Returns the URL path (the part after the hostname and port) for an incoming HTTP request as an array. The elements in the array are strings separated by the forward slash (/). If the request object is not the result of an HTTP request then an empty array is returned and last error is set.
send() - Sends an HTTP request using the data in this object. The return value is a RESTfulResponse object that has been built from the HTTP response.
setCookie(name, value) - Sets the value of the named cookie as a string. 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.
setChallengeID(value) - In the event that the outgoing RWS request requires a challenge response the value specified here will be used for the challenge ID. 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.
setChallengeSecret(value) - In the event that the outgoing RWS request requires a challenge response the value specified here will be used for the challenge secret. 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.
setMethod(method) - Sets the HTTP request method. This can be GET, POST, PUT or DELETE. If one of these values is not specified then the method will be set to GET and last error will be set. 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.
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.
setParameter(name, value) - Sets a request query parameter. If the property already exists then the value is replaced by the new value. 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.
setProxyServer(url) - In the event that the outgoing RWS request requires a proxy the proxy server specified here will be used. 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.
setProxyPort(port) - In the event that the outgoing RWS request requires a proxy the proxy port specified here will be used. 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.
setProxyPassword(password) - In the event that the outgoing RWS request requires a proxy the proxy password specified here will be used. 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.
setProxyUser(user) - In the event that the outgoing RWS request requires a proxy the proxy user specified here will be used. 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.
setTimeout(milliseconds) - Sets the timeout to be used when sending an HTTP request, therefore it is time in which a response to the request must be received. 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.
setURL(string) - Sets the URL for an HTTP request. Note that this should include the protocol, the server, the port and the path. It can include parameters in a query string but any parameters defined in the object will also be put in the query string. 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.
response.Reference = request.send()
request.clear(lastError)
request.clearlastError()
request.setURL(URL)
request.setmethod(MethodName), GET/PUT/DELETE
request.lastErrorMsg(Error Number);
$call = request.getJSON(Path)
request.setParameter(Name, Value)
request.setString(Path, Value)
Topic ID: 400030