I got an 503 error says ‘Service Unavailable’ when I was trying to POST a multipart content to google drive via sdk v2. I got an empty response content and a header as 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 work around by POST to create metadata and then PUT with uploadType=media to update, but I don’t want to make two API calls.
Any idea?
Probably not. A 503 Error simply indicates server down for repair or something. It’s minimally capable of responding with the 503 error but it is basically down. Read this if you want to know more: