How to get user image in Microsoft Graph using python
问题 I tried using GET https://graph.microsoft.com/v1.0/me/photo/$value to get the user's image/photo but it only returns an HTTP 200 status code. How can I get the binary data? graph_url = 'https://graph.microsoft.com/v1.0' def get_user(token): graph_client = OAuth2Session(token=token) # Send GET to /me user = graph_client.get('{0}/me'.format(graph_url)) # Return the JSON result* return user.json() def get_image(token): graph_client = OAuth2Session(token=token) # Send GET to /me image = graph