我注意到,自2013年7月29日以來,GCS webservice已經開始返回「HTTP/1.1 100 Continue」而不是通常的「HTTP/1.1 200 OK 「(後面是關於服務器的一些元數據)。Google Cloud Storage:上傳對象正在返回HTTP/1.1 100繼續
這是在我的一端做PUT對象時看到的。
我的問題是,我該如何解決這個問題?我只是重新發送請求?我是否將請求重新指向另一個地點?
這裏是我的要求是什麼樣子:
$headers = array('Host: '.$bucket.'.commondatastorage.googleapis.com',
'Date: '.$timestamp, $version_header, 'Content-Type: text/plain',
$project_header, 'Content-Length: '.filesize($objectPath),
'Authorization: OAuth '.$accessToken);
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $url);
curl_setopt($c, CURLOPT_PUT, 1);
curl_setopt($c, CURLOPT_INFILE, $fp);
curl_setopt($c, CURLOPT_INFILESIZE, filesize($objectPath));
curl_setopt($c, CURLOPT_HEADER, 1);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($c, CURLOPT_TIMEOUT, 60); //timeout in 60s
curl_setopt($c, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($c);
您是否正在發送'Expect:100-continue'標題? –
我不這麼認爲。我會用我的請求的樣子更新我的問題。 –
如果您不需要,您必須禁用Expect標題。看到鏈接的答案。 – jterrace