我注意到,自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