当我从特定电子邮件请求附件时,我正在使用 Outlook API 并收到此响应:
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('myname%40hotmail.com.au')/messages('AQMkADAwATMwMAItYTZiNi05ZDgxLTAwAi0wMAoAtytTDBXFHqNdTw8vNERkHALm9xdAw4PxPkb4h1HfN4XIAAAIBDAAAALm9xdAw4PxPkb4h1HfN4XIAAmBXCV8AAAA%3D')/attachments",
"value": [
{
"@odata.type": "#microsoft.graph.fileAttachment",
"id": "AQMkADAwATMwMAItYTZiNi05ZDgxLTAwAi0wMAoARgAAAyyLyoTDBXFHqNdTw8vNERkHALm9xdAw4PxPkb4h1HfN4XIAAAIBDAAAALm9xdAw4PxPkb4h1HfN4XIAAmBXCV8AAAABEgAQAIqjEp9FM2tKv4ahCWsIb7w=",
"lastModifiedDateTime": "2019-05-01T11:58:33Z",
"name": "Testfile.pdf",
"contentType": "application/pdf",
"size": 1013696,
"isInline": False,
"contentId": "ffeefe77-9bab-4736-83a3-79d921d3907b@icloud.com",
"contentLocation": None,
"contentBytes": "JVBERi0xLjYKJeLj...
我只展示了contentBytes
价值的一小部分,因为它太长了,但它是我感兴趣的。
我尝试contentBytes
使用 base64 模块解码该值并得到了这个(仅显示部分结果)
%PDF-1.6\n%âãÏÓ\n68 0 obj<</Length 1121/Filter/FlateDecode>>stream\nH\x89¬WÛnÛ8\x10}×WÌÛÊ\x0f¡y\x11%1\x08\x0cÄn\x12´@Òl¬E±\x08\x8a\x85bÓ±x12Ý*SÉöïw(É\x89ÝjÓ@.\x0c[\x129\x9a3sfxH\x8fgs\n³9Ðæ\x03óÙ\x95C\x89\x84gðà\x12\x9cñ\x05ÎÞo\x9coÀ\x9ay\x06\x8c\x86ÄçL\x02c\x8a\x84\x8a+Xd\x8e\x9dÊ\x1c¡|¼¦ÎÜùÓ\x19[·\x8b\x8d}\x01?°YäÖ`....
我怎样才能看到pdf的实际内容?