#!/usr/bin/perl -w use strict; use LWP::UserAgent; use HTTP::Request; my $xmlString = '<Leads vid="1234" lid="1234" aid="1234"> <Lead reference="ABC1234"> <FirstName>John</FirstName> <LastName>Doe</LastName> <Email>noemail@lead.com</Email> </Lead> </Leads>'; my $userAgent = LWP::UserAgent->new(); my $request = HTTP::Request->new(POST => 'http://leads.leadexec.net/processor/insert/general'); $request->content($xmlString); $request->content_type("text/xml; charset=utf-8"); my $response = $userAgent->request($request); if($response->code == 200) { print $response->as_string; } else { print $response->error_as_HTML; }In the example above, the example POST XML is posted to the POST URL. The response is then received and would then be processed to determined the desired action depending on the sending page's requirements and method sent to.
Copyright ©2024 ClickPoint Software