[ic] HTTP POSTing to another server from IC

Grant listbox at email.com
Thu Aug 21 15:00:57 EDT 2003


> How about running your sub through perl to check the syntax
> (perl -cw perl_script, for example) before trying to get Interchange
> to cope with it? :)
> Good luck,
> John

Sorry about that.  I've cleaned that up and I still get the same error when
restarting IC.  Running it through perl -cw I get the following:

Number found where operator expected at posttourl.tag line 2, near
"Interpolate 1"
        (Do you need to predeclare Interpolate?)
syntax error at posttourl.tag line 2, near "Interpolate 1"
Semicolon seems to be missing at posttourl.tag line 2.
syntax error at posttourl.tag line 33, near "}"
posttourl.tag had compilation errors.

But I copied lines 2 and 33 straight from the example posttourl tag.  Here's
my tag the way it is now:

Usertag posttourl Order url params apicall
Usertag posttourl Interpolate 1
Usertag posttourl Routine <<EOR
sub {
require HTTP::Request;
require HTTP::Headers;
require LWP::UserAgent; # SSL cabable if Crypt::SSLeay installed
        my $url=shift; my $params=shift;
        $ENV{'HTTPS_VERSION'} = '3';

        my $page="";
        my $request=new HTTP::Request 'POST' => $url;

        my $ua=LWP::UserAgent->new;
        my $response = $ua->request($request);
        return $page;

Just to reiterate, I'm trying to post an XML request and a series of
specific headers to a remote server via HTTP.

- Grant

More information about the interchange-users mailing list