我正在尝试将文件(在此示例中为png)上传到Google云存储,但是我的请求失败,并显示以下400错误请求响应。
{
"error": {
"errors": [
{
"domain": "global",
"reason": "required",
"message": "Required"
}
],
"code": 400,
"message": "Required"
}
}
我的POST请求看起来像这样。
POST https://www.googleapis.com/upload/storage/v1/b/unit_tests/o?uploadType=media HTTP/1.1
Accept: application/json, text/json, text/x-json, text/javascript
Authorization: OAuth XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Content-Type: image/png
Host: www.googleapis.com
Transfer-Encoding: chunked
Expect: 100-continue
Accept-Encoding: gzip, deflate
Connection: Keep-Alive
96DA5
�PNG
���
IHDR����������e�����sRGB�������gAMA����
�a��� pHYs�������o�d����IDATx^�|W��?o��������������,Y`I
*** FIDDLER: RawDisplay truncated at 128 characters. Right-click to disable truncation. ***
每文档我已经提供了必要的paramters等,所以我不能看到什么是必需的,我不提供。
您忘记name
在URL中提供参数。有关更多详细信息,请参见简单上传文档。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句