Ich sehe nie, wie PUT/DELETE
Anfrage gesendet wird.Wie starte ich eine GET/POST/PUT/DELETE Anfrage und beurteile den Anfragetyp in PHP?
Wie geht das in PHP?
Ich weiß, wie eine GET/POST-Anfrage mit curl senden:
$ch = curl_init();
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookieFile);
curl_setopt($ch, CURLOPT_COOKIEFILE,$cookieFile);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 4);
Aber wie PUT
/DELETE
Anfrage zu tun?
Um eine PUT-Anfrage zu bekommen, you cant do _PUT $ [ 'var'], aber: 'parse_str (file_get_contents ('php: // input'), $ put_vars);' – Strae
'$ _PUT' wird fehlschlagen, aber' php: // input' funktioniert. – user198729