简体   繁体   English

从远程服务器检索数据

[英]Retrieve data from remote server

I'm trying to find a way to retrieve data (xml or json format) from remote web application and then to parse same data in Java? 我正在尝试找到一种从远程Web应用程序检索数据(xml或json格式)然后解析Java中相同数据的方法? Is there any way to pass url to remote host, get response and retrieve data in way suitable for further processing in Java? 有什么方法可以将url传递给远程主机,获取响应并以适合Java进一步处理的方式检索数据?

Any kind of help is appreciated! 任何帮助表示赞赏!

Yes. 是。 You would send an HTTP request, read its response, and parse it. 您将发送一个HTTP请求,读取其响应并进行解析。 This can be made using an URLConnection , or using a library like apache HttpCLient if you need more flexibility. 如果需要更大的灵活性,可以使用URLConnection或使用apache HttpCLient之类的库来实现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM