Sündmused
Microsoft 365 kogukonnakonverents
6. mai, 14 - 9. mai, 00
Oskused tehteajamise ajastuks parimal kogukonna juhitud Microsoft 365 üritusel, 6.–8. mail Las Vegases.
LisateaveSeda brauserit enam ei toetata.
Uusimate funktsioonide, turbevärskenduste ja tehnilise toe kasutamiseks võtke kasutusele Microsoft Edge.
For some requests, you might want to respond with binary data like documents or images.
In Dev Proxy, you can define a binary response by setting the response.body
to a string value that starts with @
followed by file path relative to the current working directory, for example:
{
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.24.0/mockresponseplugin.schema.json",
"mocks": [
{
"request": {
"url": "https://graph.microsoft.com/v1.0/users/*/photo/$value",
"method": "GET"
},
"response": {
"body": "@picture.jpg",
"headers": [
{
"name": "content-type",
"value": "image/jpeg"
}
]
}
}
]
}
When you call GET https://graph.microsoft.com/v1.0/users/ben@contoso.com/photo/$value
, you get the image stored in the picture.jpg
file in the current directory.
Ettevaatust!
If you're using the command line to execute the HTTP request, ensure that you have correctly escaped the dollar
sign. See Why is proxy not mocking my binary response.
Learn more about the MockResponsePlugin.
See also the related Dev Proxy samples:
Toote „Dev Proxy“ tagasiside
Dev Proxy on avatud lähtekoodiga projekt. Tagasiside andmiseks valige link:
Sündmused
Microsoft 365 kogukonnakonverents
6. mai, 14 - 9. mai, 00
Oskused tehteajamise ajastuks parimal kogukonna juhitud Microsoft 365 üritusel, 6.–8. mail Las Vegases.
LisateaveKoolitus
Moodul
Access user photo information by using Microsoft Graph - Training
Learn how to create a custom JavaScript application to retrieve user photo information by using Microsoft Graph.
Dokumentatsioon
How to simulate different responses from the same endpoint
How to specify which mocks file to use
MockGeneratorPlugin - Dev Proxy
MockGeneratorPlugin reference