Print Page as PDF
xobw.RestRequest ICR (5458)

xobw.RestRequest    ICR (5458)

Name Value
NUMBER 5458
IA # 5458
DATE CREATED 2009/06/10
CUSTODIAL PACKAGE WEB SERVICES CLIENT
USAGE Supported
TYPE Other
DBIC APPROVAL STATUS APPROVED
NAME xobw.RestRequest
GENERAL DESCRIPTION
This class is used to make REST-type requests to an
external web service.

The class extends Cache's %Net.HttpRequest class. As such, all methods in the
parent class are avialable in this one as well.
STATUS Active
DURATION Till Otherwise Agreed
COMPONENT/ENTRY POINT
COMPONENT/ENTRY POINT COMPONENT DESCRIPTION VARIABLES
Get
method Get(resource As %String, test As %Integer = 0)
returns %Status

Issue the Http 'get' request, this will cause the web server to return the
page requested. If this completes correctly the response to this request will
be in the HttpResponse. The location is the url to request, e.g. '/test.html'.
This can contain parameters which are assumed to be already URL escaped, e.g.
'/test.html?PARAM=%25VALUE' sets PARAM to %VALUE. If test is 1 then instead of
connecting to a remote machine it will just output what it would have send to
the web server to the current device, if test is 2 then it will output the
response to the current device after the Get. This can be used to check that
it will send what you are expecting. This calls Reset automatically after
reading the response, except in test=1 mode or if reset=0.
VARIABLES TYPE VARIABLES DESCRIPTION
resource Input
the url to request, e.g. '/test.html'.
test Input
If test is 1 then instead of connecting to a remote
machine it will just output what it would have send to the web server to the
current device, if test is 2 then it will output the response to the current
device after the Get. This can be used to check that it will send what you are
expecting.
return value Output
a Cache %Library.status object. Many of the methods
provided by the Cache Class Library return error status information using the
%Status data type.
Head
method Head(resource As %String, test As %Integer =
0) returns %Status

Issue the Http 'head' request, this will cause the web server to just return
the header of the response and none of the body. If this completes correctly
the response to this request will be in the HttpResponse. The location is the
url to request, e.g. '/test.html'. This can contain parameters which are
assumed to be already URL escaped, e.g. '/test.html?PARAM=%25VALUE' sets PARAM
to %VALUE. If test is 1 then instead of connecting to a remote machine it will
just output what it would have send to the web server to the current device,
if test is 2 then it will output the response to the current device after the
Head. This can be used to check that it will send what you are expecting. This
calls Reset automatically after reading the response, except in test mode or
if reset=0.
VARIABLES TYPE VARIABLES DESCRIPTION
resource Input
he url to request, e.g. '/test.html'.
test Input
If test is 1 then instead of connecting to a remote
machine it will just output what it would have send to the web server to the
current device, if test is 2 then it will output the response to the current
device after the Get. This can be used to check that it will send what you are
expecting.
return value Output
a Cache %Library.status object. Many of the methods
provided by the Cache Class Library return error status information using the
%Status data type. The status represents success or failure.
POST
method Post(resource As %String, test As %Integer =
0) returns %Status

Issue the Http 'post' request, this is used to send data to the web server
such as the results of a form, or upload a file. If this completes correctly
the response to this request will be in the HttpResponse. The location is the
url to request, e.g. '/test.html'. This can contain parameters which are
assumed to be already URL escaped, e.g. '/test.html?PARAM=%25VALUE' sets PARAM
to %VALUE. If test is 1 then instead of connecting to a remote machine it will
just output what it would have send to the web server to the current device,
if test is 2 then it will output the response to the current device after the
Post. This can be used to check that it will send what you are expecting. This
calls Reset automatically after reading the response, except in test=1 mode or
if reset=0.
VARIABLES TYPE VARIABLES DESCRIPTION
resource Input
the url to request, e.g. '/test.html'.
test Input
If test is 1 then instead of connecting to a remote
machine it will just output what it would have send to the web server to the
current device, if test is 2 then it will output the response to the current
device after the Get. This can be used to check that it will send what you are
expecting.
return val Output
a Cache %Library.status object. Many of the methods
provided by the Cache Class Library return error status information using the
%Status data type.  The status represents success or failure.
Put
method Put(resource As %String, test As %Integer = 0)
returns %Status

Issue the Http 'put' request, this is used to upload data to the web server,
it is not used that often. If this completes correctly the response to this
request will be in the HttpResponse. The location is the url to request, e.g.
'/test.html'. This can contain parameters which are assumed to be already URL
escaped, e.g. '/test.html?PARAM=%25VALUE' sets PARAM to %VALUE. If test is 1
then instead of connecting to a remote machine it will just output what it
would have send to the web server to the current device, if test is 2 then it
will output the response to the current device after the Put. This can be used
to check that it will send what you are expecting. This calls Reset
automatically after reading the response, except in test=1 mode or if reset=0.

put
method Put(resource As %String, test As %Integer = 0)
returns %Status

Issue the Http 'put' request, this is used to upload data to the web server,
it is not used that often. If this completes correctly the response to this
request will be in the HttpResponse. The location is the url to request, e.g.
'/test.html'. This can contain parameters which are assumed to be already URL
escaped, e.g. '/test.html?PARAM=%25VALUE' sets PARAM to %VALUE. If test is 1
then instead of connecting to a remote machine it will just output what it
would have send to the web server to the current device, if test is 2 then it
will output the response to the current device after the Put. This can be used
to check that it will send what you are expecting. This calls Reset
automatically after reading the response, except in test=1 mode or if reset=0.

VARIABLES TYPE VARIABLES DESCRIPTION
resource Input
the url to request, e.g. '/test.html'.
test Input
If test is 1 then instead of connecting to a remote
machine it will just output what it would have send to the web server to the
current device, if test is 2 then it will output the response to the current
device after the Get. This can be used to check that it will send what you are
expecting.
return val Output
a Cache %Library.status object. Many of the methods
provided by the Cache Class Library return error status information using the
%Status data type.  The status represents success or failure.
DATE ACTIVATED 2009/06/17