microsoft-graph-explorer-v4 icon indicating copy to clipboard operation
microsoft-graph-explorer-v4 copied to clipboard

Binary content type in the request body

Open saper opened this issue 3 years ago • 2 comments

Is your feature request related to a problem? Please describe. After https://github.com/microsoftgraph/microsoft-graph-explorer-v4/issues/626 we can now see non-text content types when received from the API.

What I would like to be able to do is to upload an image using Graph Explorer, for example for

https://graph.microsoft.com/v1.0/me/photo/$value

Describe the solution you'd like

Ability to attach a binary file to replace the "Request body" part Ability to select a content type (image/png or image/jpeg, maybe more could be supported). Having it display in the Graph Explorer is nice to have.

Describe alternatives you've considered

What do I now is to copy the access token out of the explorer and use

  curl -X PUT -H "Authentication: Bearer ${TOKEN}" \
              -H 'Content-Type: image/png'  --data-binary @file_i_need.png \
              'https://graph.microsoft.com/v1.0/me/photo/$value'

saper avatar May 09 '22 14:05 saper

If the primary goal is update tenant data, then the best option is to use the PowerShell cmdlet https://docs.microsoft.com/en-us/powershell/module/microsoft.graph.users/set-mguserphotocontent?view=graph-powershell-1.0

Graph Explorer is optimized for learning experiences.

darrelmiller avatar Jun 17 '22 15:06 darrelmiller

Graph Explorer is optimized for learning experiences.

It should not prevent us from doing useful things, though...

saper avatar Jun 18 '22 12:06 saper