2

As part of the payload returned for messages.get(), I get the following

  "parts": [
        {
            "body": {
                "data": "Q29udHJWxpZWYsIExvcmVtIElwc3VtIGlz......much longer",

How do read the actual message? Basically, how do I decrypt/decode this information so it's actual English text?

I'm using the Python libraries for the Gmail API.

4

2 回答 2

5

我认为数据是base64编码的,所以在python中你会做这样的事情

import base64

string_enc = <some_base64_encoded_string>
string = base64.b64decode(string_enc)
于 2014-07-06T16:28:03.950 回答
2

我认为它的 base 64 URL Encoded与 Base 64 编码不同。

于 2014-07-06T19:57:30.280 回答