Here is what I have done. This is on server 1:
Code: Select all
$url = 'https://valid-url.com/xml.php';
echo base64_encode($requestXML);//I echo out my end first, to make sure I am not going nuts
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'xml='.base64_encode($requestXML));
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HEADER, 0); // DO NOT RETURN HTTP HEADERS
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // RETURN THE CONTENTS OF THE CALL
$contents = curl_exec($ch);Code: Select all
<?php
echo $_POST['xml'];die();One fix would be simply to do this on server 2:
Code: Select all
<?php
echo str_replace(' ', '+', $_POST['xml']);die();So, I come to the masses to ask my humble question, wtf is going on here? Anyone ever see something like this before?
Edit: I took the correct base64 encoded string and posted it via a HTML form and it worked, so the problem has to be in cURL.