Uploading Profile Photo from Microsoft Graph Explorer

两盒软妹~` 提交于 2021-01-28 05:07:50

问题


I cannot upload a photo from Microsoft Graph Explorer. I am getting this error:

An internal server error occurred. The operation failed., The file you chose isn't an image.

I have image/jpeg as content-type and a valid binary data extracted from Fiddler. Authorization token is also there when I inspect my request from Fiddler. What did I missed?

Request body: https://pastebin.com/YDUfpRmX

Response: https://pastebin.com/e6fzDYvi

PUT https://graph.microsoft.com/beta/users/[userprincipalName]/photo/$value HTTP/1.1

Content-Length: 64408

Authorization: Bearer eyJ0eXA...

Content-Type: image/jpeg

回答1:


Graph Explorer doesn't support sending binary files at the moment. It can only handle string data in the POST/PUT/PATCH body.



来源:https://stackoverflow.com/questions/46181102/uploading-profile-photo-from-microsoft-graph-explorer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!