Ich versuche Antwort von api Anruf zu bekommen,erhalten Antwort von GET-Anfrage an API
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://fm.transfer-to.com/cgi-bin/shop/topup');
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
$response = curl_exec($curl);
echo $response;
$status = curl_getinfo($curl);
curl_close($curl);
// oben Code gibt nichts
ich file_get_contents()
versucht, aber
$url ="https://fm.transfer-to.com/cgi-bin/shop/topup";
$responses = split("\n", file_get_contents($url));
foreach ($responses as $response) {
$key = split("=", $response)[0];
$value= split("=", $response)[1];
if($key != "" && $value != "") {
$data[$key] = $value;
}
}
Es Fehler: failed to open stream: Connection timed out.
So erhalten Sie eine Antwort von API (API sendet zurück Ebene Text, nicht JSON), Wenn ich nach oben URL über Formular anfordern.
Der Endpunkt ein Rest api ist, und erwartet, dass einige Token. Überprüfen Sie, welche Tokens vom Lieferanten zur Verfügung gestellt werden und verwenden Sie diese dann gemäß der Dokumentation. – vishwakarma09