获取统一组映像时,批处理中的JSON格式错误 [英] Malformed JSON in Batch when getting Unified Group images

查看:30
本文介绍了获取统一组映像时,批处理中的JSON格式错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用请求 https://graph.microsoft.com/v1.0/ $ batch API来获取组图像,并且在批次内,单个图像响应包含"Content-Type":"image/pjpeg ",这会中断响应的json解析( JSON ...).

I'm using request https://graph.microsoft.com/v1.0/$batch API to fetch group images and within batch, single image response contains "Content-Type":"image/pjpeg" and that breaks json parsing of the response (unexpected token X in the JSON...).

请求:

{
  "requests": [
    {
      "id":"88aec8df-ea5e-4ad6-8534-3b1ac70693e2",
      "method":"GET",
      "url":"/groups/88aec8df-ea5e-4ad6-8534-3b1ac70693e2/photo/$value"
    },
    {
      "id":"beeadb9d-02cf-4437-ab7d-7762a58e70a6",
      "method":"GET",
      "url":"/groups/beeadb9d-02cf-4437-ab7d-7762a58e70a6/photo/$value"
    }
  ]
}

来自Chrome控制台的批量响应

似乎Graph批处理没有对响应json的Base64正确编码pjpeg图像.正常的"Content-Type":"image/jpeg" 图片可以正常工作.

Seems that Graph batch does not Base64 encode pjpeg images correctly to response json. Normal "Content-Type":"image/jpeg" images in batch works fine.

从已知问题中找不到与此相关的任何内容.

Did not find anything related to this from known issues.

推荐答案

出于理智的考虑:这是批处理中的一个错误,此后已解决.

For sanity purposes: this was a bug in the batch processing that has been addressed since.

这篇关于获取统一组映像时,批处理中的JSON格式错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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