{"action":"opened","issue":{"url":"https://api.github.com/repos/jasonjoh/python_tutorial/issues/3","labels_url":"https://api.github.com/repos/jasonjoh/python_tutorial/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/jasonjoh/python_tutorial/issues/3/comments","events_url":"https://api.github.com/repos/jasonjoh/python_tutorial/issues/3/events","html_url":"https://github.com/jasonjoh/python_tutorial/issues/3","id":102968570,"number":3,"title":"Sending emails with attachments. ","user":{"login":"psihonavt","id":703402,"avatar_url":"https://avatars.githubusercontent.com/u/703402?v=3","gravatar_id":"","url":"https://api.github.com/users/psihonavt","html_url":"https://github.com/psihonavt","followers_url":"https://api.github.com/users/psihonavt/followers","following_url":"https://api.github.com/users/psihonavt/following{/other_user}","gists_url":"https://api.github.com/users/psihonavt/gists{/gist_id}","starred_url":"https://api.github.com/users/psihonavt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psihonavt/subscriptions","organizations_url":"https://api.github.com/users/psihonavt/orgs","repos_url":"https://api.github.com/users/psihonavt/repos","events_url":"https://api.github.com/users/psihonavt/events{/privacy}","received_events_url":"https://api.github.com/users/psihonavt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-08-25T07:39:58Z","updated_at":"2015-08-25T07:39:58Z","closed_at":null,"body":"Not really related to python-tutorial, but related to using Outlook Mail REST API in python :) And I'd say that extending tutorial with answer to my question will be very beneficial (googling does not help me). \r\n\r\nSo, I'm trying to use next API method: https://msdn.microsoft.com/office/office365/APi/mail-rest-operations#SendMessages. Sending messages without attachments works just fine, but I can not understand how to send message with attachments. According to docs, `Message` structure can contain array of `Attachments` with items of type https://msdn.microsoft.com/office/office365/APi/complex-types-for-mail-contacts-calendar#RESTAPIResourcesFileAttachment Problem is in the field `ContentBytes` -- it is impossible to dump bytes to JSON before sending request to this API method (actually dumping any BLOB to JSON is nonsense). \r\nHow should we pass Attachments using REST API at all, and specifically using python `requests` (or any other library)?\r\n\r\nThanks."}}