Rumah > Soal Jawab > teks badan
P粉4594409912023-08-15 09:27:43
Anda perlu...
"Tukar serta-merta arahan curl kepada kod PHP"
P粉2580834322023-08-15 00:18:05
Titik permulaan:
<?php $pageurl = "http://hostname/@api/deki/pages/=TestPage/files/="; $filename = "test.png"; $theurl = $pageurl . $filename; $ch = curl_init($theurl); curl_setopt($ch, CURLOPT_COOKIE, ...); // -b curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); // -X curl_setopt($ch, CURLOPT_BINARYTRANSFER, TRUE); // --data-binary curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: image/png']); // -H curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); // -0 ... ?>
Anda juga boleh merujuk kepada: http://www.php.net/manual/en/function.curl-setopt.php