413 - Request Entity Too Large

*爱你&永不变心* 提交于 2019-11-28 13:47:28
Eric D

You need to use the /upload "media upload" path to upload anything over a few MB. The URL and POST format are slightly different:

You'd do:

  1. POST https://www.googleapis.com/upload/gmail/v1/users/userId/drafts
  2. add a HTTP header like "Content-type: multipart/related; boundary=\"part_boundary\""
  3. POST body looks more like:
--part_boundary
Content-Type: application/json; charset=UTF-8

{
}

--part_boundary
Content-Type: message/rfc822

From: script@example.org
To: user@example.com
Subject: test

body here

--part_boundary--

See this for more info (which then links to this).

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!