I have a 503 error that says the "Service is unavailable" error when I tried to send multi-page content to a Google drive via sdk v2. I got the empty content of the response and the header as shown below:
{'content-length': '0', 'x-google-cache-control': 'remote-fetch', 'expires': 'Fri, 01 Jan 1990 00:00:00 GMT', 'server': 'HTTP Upload Server Built on Jun 14 2012 02:12:09 (1339665129)', 'via': 'HTTP/1.1 GWA', 'pragma': 'no-cache', 'cache-control': 'no-cache, no-store, must-revalidate', 'date': 'Tue, 03 Jul 2012 23:12:09 GMT', 'content-type': 'text/html; charset=UTF-8'}
Here is what I posted:
POST /upload/drive/v2/files?uploadType=multipart
Authorization: Bearer <Access token>
Content-Length: <length>
Content-Type: multipart/related; boundary="<a base64 encoded guid>"
--<a base64 encoded guid>
Content-Type: application/json
{"title": "test.jpg", "mimeType":"image/jpeg", "parents":[]}
--<a base64 encoded guid>
Content-Type: image/jpeg
Content-Transfer-Encoding: base64
<base64 encoded binary data>
--<a base64 encoded guid>--
Did I do something wrong? I can successfully run POST to create metadata, and then PUT with uploadType = media to update, but I do not want to make two API calls.
Any idea?
source
share