Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 3 Tools : $HTTPREQUEST

$HTTPREQUEST
Issues an HTTP request and returns the response code and result. (F)
Invocation
value = $HTTPREQUEST(requesttype, url, header, data, result, message)
On return, contains the HTTP response code as an integer value. The return value has type C, syntax B, and length 4.
The HTTP header parameters for the HTTP request, in the form name=value. It has a length of 2048.
A variable used to contain any error message resulting from the HTTP request. It has a length of 512.
Usage Notes
The data parameter can be used to pass FORMAT input fields to an HTML form page. Form parameters look like query string parameters on a URL request. They are passed as a series of name=value pairs, each separated by an ampersand character.
For example, if a form has two parameters, USERID and PASSWORD, and your rule passes the constant string ‘USERID=ME,PASSWORD=PWD’ as the value of the data parameter, the HTML form receives ‘ME’ as the value for the ‘USERID’ parameter and ‘PWD’ as the value for the ‘PASSWORD’ parameter.
Take care when passing data using the data parameter of this rule. By default, the data is passed as plain text for GET requests, and as application/x-www-form-urlencoded data for POST requests.
Example
The following example shows how $HTTPREQUEST can be called in a rule:

 
GETTEST();
- LOCAL HTTPCODE, URL, HEADER, DATA, RESULT, MESSAGE;
_ --------------------------------------------------------------------------------
_ --------------------------------------------------------------------------+-----
_ URL = 'HTTP://WWW.TIBCO.COM/POSTTEST.ASP?P1=1&P2=AAA'; | 1
_ HTTPCODE = $HTTPREQUEST('GET', URL, HEADER, DATA, RESULT, MESSAGE); | 2
_ CALL ENDMSG('RC=' || HTTPCODE || ', M=' || MESSAGE || ', R=' || RESULT); | 3
_ |
-------------------------------------------------------------------------------

 
 

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved