I am trying to upload an email to gmail account using gmail REST API for import message https://developers.google.com/gmail/api/v1/reference/users/messages/import#http-request using python requests module. email is in RAW format (i.e. data of .eml file encoded with base64.b64encode()) with body
POST https://www.googleapis.com/gmail/v1/users/me/messages/import
{
"raw": ".........."
}
This is working for RAW data size up to few MBs (say 5MB), but I am getting 'Connection Timeout' error if i try to upload bigger data (~10 MB or more).
Can anybody tell me the way to upload bigger email data using this API.
I am using OAuth access_token to call these APIs