首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java相关 >

UnsupportedMimeTypeException错误怎么处理

2013-11-14 
UnsupportedMimeTypeException异常怎么办?org.jsoup.UnsupportedMimeTypeException: Unhandled content ty

UnsupportedMimeTypeException异常怎么办?

org.jsoup.UnsupportedMimeTypeException: Unhandled content type. Must be text/*, application/xml, or application/xhtml+xml. Mimetype=application/json; charset=UTF-8, URL=http://mp.weixin.qq.com/cgi-bin/singlesend?t=ajax-response&lang=zh_CN
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:453)
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:410)
at org.jsoup.helper.HttpConnection.execute(HttpConnection.java:164)
at org.jsoup.helper.HttpConnection.post(HttpConnection.java:159)

求解!! java 异常
[解决办法]
类型不支持啊  。 MimeType
[解决办法]
必须使用下面的mimetype
text/*, application/xml, or application/xhtml+xml. 
你用的是json?
[解决办法]
header("Content-type: application/json");你的代码里设置看看
[解决办法]
Use ignoreContentType();
Document pod = Jsoup.connect(myURL).ignoreContentType(true).get();

热点排行