PHP cURL HTTP PUT
我正在尝试使用cURL创建一个HTTP PUT请求,但无法使其正常工作。我已经阅读了许多教程,但没有一个真正起作用。这是我当前的代码: $filedata = array('metadata' => $rdfxml); $ch = curl_init($url); $header = "Content-Type: multipart/form-data; boundary='123456f'"; curl_setopt($ch, CURLOPT_VERBOSE, 1); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, array($header)); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($filedata)); $returned = curl_exec($ch); if (curl_error($ch)) { print curl_error($ch); } else { print 'ret: ' .$returned; } 我也尝试使用PHP …