2

我正在尝试使用 Google Groups Migration API 向 Google Group 添加条目。根据我使用这个网址的文档:

https://www.googleapis.com/upload/groups/v1/groups/groupId/archive?uploadType=media

我认为我正确地提供了身份验证令牌(通过了 http 401 错误)。现在我收到 http 500,内部服务器错误。我的http标头是:

Content-Length: 291
Content-Type: message/rfc822

接下来的数据是我可以制作的普通 rfc822 类型的消息:

From: "John Doe" <missing_email@domain.com>
To: "Jane Doe" <missing_email@domain.com>
Subject: forward test
MIME-Version: 1.0
Date: Fri, 19 Feb 2016 08:03:00 -0800
Content-Type: message/rfc822

This is the first line of the forward test.

我还有一些其他代码可以在 Gmail 文件夹中创建消息,效果很好。为此,我执行“uploadType=multipart”,并以 json 格式创建我的数据。我也尝试为 Groups 这样做,但没有运气。有任何想法吗?

4

1 回答 1

2

Content-Type请求的内容如message/rfc822您所说,但消息的实际纯文本部分不是:

Content-Type: text/plain; charset="UTF-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
To: receiver@gmail.com
From: sender@gmail.com
Subject: Subject Text

The actual message text goes here
于 2016-02-20T02:33:16.203 回答