Microsoft Graph上传图片

时间:2018-08-08 09:21:41

标签: azure microsoft-graph put

我正在尝试向https://graph.microsoft.com/v1.0/me/photo/$value发出PUT请求 使用Microsoft Graph Explorer

但是我收到内部错误500。我是在做错什么还是Graph API有问题

    {
    "error": {
        "code": "ErrorInternalServerError",
        "message": "An internal server error occurred. The operation failed., The file you chose isn't an image. Please choose a different file.",
        "innerError": {
            "request-id": "60c801ff-7d83-47a1-9d38-c01a4769ec1b",
            "date": "2018-08-08T09:28:18"
        }
    }

1 个答案:

答案 0 :(得分:2)

在当前状态下,您无法使用Microsoft Graph Explorer上传二进制文件。使用Postman上传二进制文件。发出带有“ User.ReadWrite”作为权限且Content-Type:Image / Jpeg的PUT请求。