开发者

Files downloading

How do I go about connecting to a server and check if there is a file to be downloaded using Java ME?

Should I use POST method, post all my required data to server and see what the server response back? And also what are the headers do I have to post together wit开发者_如何学运维h my data?

Or do I have to use a Get method?


You don't need it to do by hand. Just use

HttpConnection connection = Connector.open(url);
DataInputStream stream = connection.openDataInputStream();
while(stream.read() != -1) {
    //your stuff if anything there
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜