Hallo!
Aktuell stehe ich vor einem Anfängerproblem.
Es sollen XML-Daten per Curl an einen Server gesendet werden.
Folgende Daten müssen gesendet werden:
Code:
<?xml version="1.0" encoding="utf-8"?>
<request>
<auth>
<user>login</user>
<password>pw</password>
<context>77375</context>
</auth>
<task>
<code>log332</code>
</task>
</request>
Folgendes besteht bereits:
PHP-Code:
class adns {
function requestCurl( $request ) {
$ch = curl_init("https://server.com");
curl_setopt($ch, CURLOPT_POSTFIELDS, $request );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
if( !$response= curl_exec( $ch )) {
echo "CURL execution error.", curl_error( $ch ) ."\n";
return FALSE;
}
curl_close( $ch );
while(substr($response, 0, 21) == "HTTP/1.1 100 Continue") {
$response = substr($response, 25);
}
return $response;
}
}
Nur wo und wie kommt nun der zu übermittelnde XML-Code hin?
Kann mir hier jemand Hilfe geben?
Ich bedanke mich vorab!
Grüße
Frank