Products | Versions |
---|---|
TIBCO BusinessEvents Enterprise Edition | - |
Not Applicable | - |
Resolution:
Description:
===========
Sending a HTTP request with a parameter from TIBCO BusinessEvents.
Environment:
===========
TIBCO BusinessEvents 4.x,5.x
All Operating Systems
Resolution:
========
Use HTTP.encodeURL to encode the parameter part. Compose the request URL with parameters.
The following http://maps.googleapis.com will be used as an example.
>>>>>>>>>>>>>
String reqUrl1="http://maps.googleapis.com/maps/api/geocode/xml?address=";
String addr = "3301 Hill View Ave, Palo Alto, CA";
String reqUrl2="&sensor=";
String sens = "false";
String reqUrl=reqUrl1+HTTP.encodeURL(addr,"UTF-8")+reqUrl2+HTTP.encodeURL(sens,"UTF-8");
<<<<<<<<<<<<<
The final request URL looks like the following:
http://maps.googleapis.com/maps/api/geocode/xml?address=3301+Hill+View+Ave%2C+Palo+Alto%2C+CA&sensor=false
Now use the HTTP.sendRequest to send request event to this URL:
HTTP.sendRequest(reqUrl, request, "/Events/httpResponse", 1000);
The response is returned to BE with the following payload:
>>>>>>>>>>
<?xml version="1.0" encoding="UTF-8"?>
<GeocodeResponse>
<status>OK</status>
<result>
<type>street_address</type>
<formatted_address>3301 Hillview Ave, Palo Alto, CA 94304, USA</formatted_address>
…
</GeocodeResponse>
<<<<<<<<<<