如何在php中发送此请求?
https://developers.google.com/drive/manage-uploads#resumable
POST /upload/drive/v2/files?uploadType=resumable HTTP/1.1
Host: www.googleapis.com
Authorization: your_auth_token
Content-Length: 38
Content-Type: application/json; charset=UTF-8
X-Upload-Content-Type: image/jpeg
X-Upload-Content-Length: 2000000
{
"title": "My File"
}
看看
PHP curl。 您可以使用它发出请求,并根据需要更改请求中的标头。
PHP 文档
http://php.net/manual/en/book.curl.php
教程开始
http://coderscult.com/php-curl-tutorial-and-example/
但是Google云端硬盘有一个出色的API,那么为什么不使用它呢?
https://developers.google.com/drive/manage-uploads