通过谷歌驱动器sdk v2上传multipart时出现503错误 [英] Got 503 error when uploading multipart via google drive sdk v2

查看:150
本文介绍了通过谷歌驱动器sdk v2上传multipart时出现503错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试通过sdk v2将多部分内容发布到谷歌驱动器时,出现503错误,提示'Service Unavailable'。我收到了一个空的响应内容和一个标题如下:

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'}

以下是我发布的内容:

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>--

我做错了什么?我可以通过POST成功解决问题以创建元数据,然后使用uploadType = media更新PUT,但我不想进行两个API调用。

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.

有什么想法?

推荐答案

可能不是。一个503错误只是表明服务器停机修理或其他事情。它最低限度地能够响应503错误,但基本上是停机。如果您想了解更多信息,请阅读:

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:

http://www.checkupdown.com/status/E503.html

这篇关于通过谷歌驱动器sdk v2上传multipart时出现503错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆