我试图理解本文档中给出的步骤: https://cloud.google.com/storage/docs/json_api/v1/how-tos/multipart-upload#sending_a_multipart_upload_request
步骤3,创建请求的主体,是我真正困惑的地方。完整请求需要如下所示:
POST https://www.googleapis.com/upload/storage/v1/b/myBucket/o?uploadType=multipart HTTP/1.1
Authorization: Bearer [YOUR_AUTH_TOKEN]
Content-Type: multipart/related; boundary=foo_bar_baz
Content-Length: [NUMBER_OF_BYTES_IN_ENTIRE_REQUEST_BODY]
--foo_bar_baz
Content-Type: application/json; charset=UTF-8
{
"name": "myObject"
}
--foo_bar_baz
Content-Type: image/jpeg
[JPEG_DATA]
--foo_bar_baz--
所以我知道如何使用Angular设置Content-Type,所以我可以得到它:
Content-Type: multipart/related; boundary=foo_bar_baz
但我怎么送尸体?我需要在元数据和jpeg数据之间显示边界。我甚至不知道从哪里开始这样做。
有人可以对此有所了解吗?