bobdole has asked for the wisdom of the Perl Monks concerning the following question:
I run it with all my iformation and I dont get any kind of response back so I dont know if it went through or not. How can I get the response and just print it out to the console? It looks like it might be writting the reponse somewhere, just not sure where. Thanks.#!/usr/bin/perl use URI::Escape; use IPC::Open2; my $post_url = "https://www.domain.com/cgi-bin/AcceptXML"; my $curl = "/usr/local/bin/curl"; my $curl_opt = "-H 'Content-Type: text/xml'"; my $basic_auth = ""; $post_url =~ s|://|://$basic_auth\@| if $basic_auth; open2(*README, *WRITEME, "$curl $curl_opt -d \@- $post_url 2>/dev/null +"); my $xml_out = qq[<?xml version="1.0" encoding="UTF-8"?> <SomeXml> <SomeData>1234</SomeData> <SomeOtherData>x=25%</SomeOtherData> <MoreData id="445A">Pink Elephants</MoreData> </SomeXml> ]; print WRITEME &uri_escape($xml_out); close WRITEME;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: HTTPS post with curl (RESOLVED)
by jasonk (Parson) on Feb 01, 2006 at 03:35 UTC |