从 Microsoft Graph Explorer 上传个人资料照片 [英] Uploading Profile Photo from Microsoft Graph Explorer

查看:48
本文介绍了从 Microsoft Graph Explorer 上传个人资料照片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法从 Microsoft Graph Explorer 上传照片.我收到此错误:

<块引用>

发生内部服务器错误.操作失败.您选择的文件不是图片.

我有 image/jpeg 作为 content-type 和从 Fiddler 中提取的有效二进制数据.当我检查来自 Fiddler 的请求时,授权令牌也在那里.我错过了什么?

请求正文:https://pastebin.com/YDUfpRmX

回复:https://pastebin.com/e6fzDYvi

<前>PUT https://graph.microsoft.com/beta/users/[userprincipalName]/photo/$value HTTP/1.1内容长度:64408授权:承载eyJ0eXA...内容类型:图像/jpeg

解决方案

Graph Explorer 目前不支持发送二进制文件.它只能处理 POST/PUT/PATCH 正文中的字符串数据.

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

解决方案

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

这篇关于从 Microsoft Graph Explorer 上传个人资料照片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆