P粉0304790542023-08-25 18:03:55
你需要...
「立即將curl指令轉換為PHP程式碼」
#P粉0222857682023-08-25 12:35:36
起點:
<?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 ... ?>
另請參閱:http://www.php.net/manual /en/function.curl-setopt.php
#