调用接口出现invalid media type hint?

发布于 6 年前作者 caolei8158 次浏览最后编辑 6 年前来自 issues

java代码调用

https://api.weixin.qq.com/wxa/media_check_async

接口出现{“errcode”:40004,“errmsg”:“invalid media type hint: [sKhR.a07191531]”}问题

```

HttpPost request1 = new HttpPost(https://api.weixin.qq.com/wxa/media\_check\_async?media\_type=2&access\_token=+ accessToken);

request1.addHeader("Content-Type", "application/json;charset=UTF-8");
Map<String, String> paramMap = new HashMap<String, String>();
paramMap.put("media_url", url);
request1.setEntity(new StringEntity(JSONObject.toJSONString(paramMap), ContentType.create("application/json", "utf-8")));

// 处理返回结果
CloseableHttpResponse response = httpclient.execute(request1);
HttpEntity httpEntity = response.getEntity();
String result = EntityUtils.toString(httpEntity, "UTF-8");// 转成string
System.out.println(result);
JSONObject jso = JSONObject.parseObject(result);

```

求解答

0 回复
暂无回复