No running the commented out code (which actually works; the LWP code doesn't do anything but return my Bad Request print) gives me back a response form the server saying that the XML was not included or was formattted badly. Now I know that it's formatted correctly from printing the $finalXML variable. Do I need to escape the XML somehow or something? I'm totally at a loss for what to do at this point. I was up all night trying to get this working. Any help that anyone could contribute would be wonderful and greatly appreciated. D.sub postXML { my $self = shift; my $finalXML = $self->getFinalXML(); my $POST_URL = $self->getProcessingURL(); # print $finalXML, "\n"; # use Net::SSLeay; # my ($page, $response, %reply_headers) = # Net::SSLeay::post_https( # 'secdev.sslsite.com', # 11800, # '', # Net::SSLeay::make_headers('Content-type' => 'application/ +x-www-form-urlencoded'), # Net::SSLeay::make_form(CLRCMRC_XML => "$finalXML") # ); # print 'Response: ', $response, "\n"; # print 'Page: ', $page, "\n"; use LWP::UserAgent; my $userAgentObject = LWP::UserAgent->new(); $userAgentObject->agent("ClearCommerce::XML::POST/0.1"); use HTTP::Request; my $postRequestObject = HTTP::Request->new(POST => $POST_URL); $postRequestObject->content_type('application/x-multipart-form-dat +a'); $postRequestObject->content("CLRCMRC_XML=$finalXML"); print 'Posting to ', $self->{processingURL}, " the following:\n"; print $finalXML, "\n"; my $postRequestResponseObject = $userAgentObject->request($postReq +uestObject); print $userAgentObject->request($postRequestObject)->content(); if ($postRequestResponseObject->is_success) { print $postRequestResponseObject->content(), "\n"; } else { print "Bad Request.\n"; } }
In reply to Can't Post XML to SSL Site by dpatrick
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |