我想“GET”一个RSS提要。
public RssFeed(String url) {
_url = url;
String res = this.api.get(url);
ByteArrayInputStream bis = new ByteArrayInputStream(res.getBytes());
try {
bis.close();
} catch (IOException e) {
e.printStackTrace();
}
XMLDecoder decoder = new XMLDecoder(bis);
try {
Object xml = decoder.readObject();
_response = xml.toString();
} catch(Exception e) {
e.printStackTrace();
} finally {
decoder.close();
}
}
当我检查什么是“资源”的内部。 这似乎让这整个XML。 但后来,我想对它进行解码和获取:
java.lang.IllegalArgumentException: Unsupported element: rss
有人能帮助我吗? 我是新来的Java。
谢谢!