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)
 
 
 
 
解决
Use ignoreContentType();
Document pod = Jsoup.connect(myURL).ignoreContentType(true).get();

猜你喜欢

转载自sauzny.iteye.com/blog/2148931