[ic] How to include HTTP GET response in an IC page

DB DB at M-and-D.com
Mon Jul 24 21:16:35 EDT 2006

> On 07/24/2006 04:55 PM, DB wrote:
>> On my IC-5.4 website I need to create a form with a single input field,
>> the contents of which gets added to a HTTP GET request to a remote site.
>> The reply to the request is of the format:
>> HTTP/1.1 200 OK
>> Content-Type: text/xml; charset=utf-8
>> Content-Length: length
>> <?xml version="1.0" encoding="utf-8"?>
>> <ArrayOfString xmlns="http://www.remote-site.com">
>>   <string>string</string>
>>   <string>string</string>
>> </ArrayOfString>
>> I want to extract the contents of the first instance of
>> <string>string</string>, and display that on the form's results page.
>> Can anyone help by example or point me to the proper docs?
> Use the [get-url] tag 
> <http://www.interchange.rtfm.info/docs/frames/ictags_144.html> to fetch 
> the remote page, then use perl regular expressions to filter out the 
> content you want.  Something like this should do it:
> [calcn]
> 	my $page = $Tag->get_url('http://www.example.com/mypage.xml');
> 	$page =~ m!<string>(.+?)</string>!;
> 	$1;
> [/calcn]
> Peter

OK thanks - seems to work. Now one more detail.

The url I use in the [get-url] tag contains username and password
information which anyone could view simply by looking at the source of
my IC page. Any thoughts about how to get around that problem?

I can use SOAP instead of HTML for the request, but the
username/password info is still required.


More information about the interchange-users mailing list