Here are the XML/RSS Feed file:
以下是XML / RSS Feed文件:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
xmlns:georss="http://www.georss.org/georss">
<channel>
...
<item>
...
</item>
<item>
...
</item>
</channel>
</rss>
If I want to get the file with socket like:
如果我想获得带有套接字的文件:
Socket socket = new Socket(/* THE SITE*/ , 80);
OutputStream os = socket.getOutputStream();
OutputStreamWritter osw = new OutputStreamWritter(os);
BufferedWriter bw = new BufferWriter(osw);
bw.write("HEADER OF THE SITE");
What header should I use?
我应该使用什么标题?
1 个解决方案
#1
0
You should either learn about HTTP or use a higer-level API like java.net.HttpURLConnection
.
您应该了解HTTP或使用更高级的API,如java.net.HttpURLConnection。
#1
0
You should either learn about HTTP or use a higer-level API like java.net.HttpURLConnection
.
您应该了解HTTP或使用更高级的API,如java.net.HttpURLConnection。