I want to implement a REST-Client which handles form input data and sends it to an REST Backend.
$strXml = file_get_contents($_FILES['xmlfile']['tmp_name']);
$service_url = 'api/index.php/pojects';
$curl = curl_init($service_url);
$curl_post_data = array(
"title" => $_POST['title'],
"client" => $_POST['client'],
"comment" => $_POST['comment'],
"project_number" => $_POST['project_number'],
"xml" => $strXml,
);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $curl_post_data);
$curl_response = curl_exec($curl);
curl_close($curl);
var_dump($curl_response);
var_dump($strXml);
But it seems, that there's something wrong, maybe with the webserver config. It says:
302 Found
The document has moved here.
But the var_dump of the xml string is correct. What's my error in reasoning?