Invalid value for ByteString error when calling gmail send API with base64 encoded < or>

后端 未结 5 1388
南笙
南笙 2021-01-03 22:07

Really stuck on this one and pulling my hair out trying to figure out what to do, searched everywhere and tried everything but still stuck. Any help is much appreciated.

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-03 22:31

    The Google API decodes with urlsafe_b64decode. Try to use urlsafe_b64encode (encode strings using a URL-safe alphabet, which uses - instead of + and _ instead of / in the standard Base64 alphabet.)

    In your example I see one + which means you used standard Base64.

提交回复
热议问题