Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

mpolo's scratchpad

by mpolo (Chaplain)
on Jun 01, 2004 at 20:43 UTC ( #358551=scratchpad: print w/ replies, xml ) Need Help??

---- Headers returned by code below HTTP/1.0 200 OK Content-Type: text/html Client-Date: Thu, 08 Jan 2004 12:51:58 GMT Client-Peer: 172.16.110.12:80 Client-Response-Num: 1 Refresh: 0; URL=https://www.cieups.com/ups.app/xml/Rate/ <HTML></HTML>
---- Begin program #!/usr/bin/perl use XML::Parser; use LWP::UserAgent; $lwp=LWP::UserAgent->new; $lwp->proxy(['http','https'],'http://zzzzz:xxxx@172.16.110.12:80/'); $XML=<<XML; <?xml version="1.0"?> <AccessRequest xml:lang="en-US"> <AccessLicenseNumber>xxxxx</AccessLicenseNumber> <UserId>xxxx</UserId> <Password>xxxxx</Password> </AccessRequest> <?xml version="1.0"?> <RatingServiceSelectionRequest xml:lang="en-US"> <Request> <TransactionReference> <CustomerContext>Rating and Service</CustomerContext> <XpciVersion>1.0001</XpciVersion> </TransactionReference> <RequestAction>Rate</RequestAction> <RequestOption>shop</RequestOption> </Request> <PickupType> <Qode>01</Qode> </PickupType> <Shipment> <Shipper> <Address> <PostalCode>30076</PostalCode> </Address> </Shipper> <ShipTo> <Address> <PostalCode>30041</PostalCode> </Address> </ShipTo> <Service> <Qode>11</Qode> </Service> <Package> <PackagingType> <Qode>02</Qode> <Description>Package</Description> </PackagingType> <Description>Package</Description> </PackagingType> <Description>Rate Shopping</Description> <PackageWeight> <Weight>33</Weight> </PackageWeight> </Package> <ShipmentServiceOptions/> </Shipment> </RatingServiceSelectionRequest> XML push @{ $lwp->requests_redirectable }, 'POST'; $request=HTTP::Request->new(POST =>'https://www.cieups.com/ups.app/xml +/Rate/'); $request->header('content-type'=>'application/x-www-form-urlencoded'); $request->header('content-length'=>length($XML)); print length($XML); $request->content($XML); $response=$lwp->request($request); print "\n"; #print $request->as_string; #šprint $response->status_line; #print $response->content; print $response->as_string;
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (19)
As of 2015-07-01 15:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (6 votes), past polls