【发布时间】:2018-12-11 09:52:27
【问题描述】:
我正在处理 Azure 存储表上的 REST API 调用,我成功地查询表并获得了 xml 格式的响应,但是当我尝试将 Accept 标头更改为 JSON 时,我遇到了异常。
注意:我将 x-ms-version 的值设置为 2018-03-28
headers.put("Authorization", "SharedKey " + store + ":" + hash);
headers.put("x-ms-date", date);
// headers.put("x-ms-version","2009-09-19");
headers.put("x-ms-version","2018-03-28");
headers.put("Accept-Charset","UTF-8");
// headers.put("Accept","application/atom+xml,application/xml");
headers.put("Accept","application/json;odata=nometadata");
headers.put("DataServiceVersion","1.0;NetFx");
headers.put("MaxDataServiceVersion","1.0;NetFx");
我收到响应状态代码 415,消息为“JsonFormatNotSupportedJSON 格式不受支持。”
【问题讨论】:
标签: rest azure azure-storage