[英]how to do a get request using java spark
I have to access third part api using java spark 我必须使用java spark访问第三部分api
get request http://41.1.1.92:3000/nodes 得到请求http://41.1.1.92:3000/nodes
I just want to know how to access this api using java spark and return the response 我只是想知道如何使用java spark访问这个api并返回响应
when i try to access api response is as shown below 当我尝试访问api响应时如下所示
[
{
"host": "ip-133472-334341-134341-4834",
"ip": "5342.1344.1344.9342",
"status": "Healthy",
"containers": "8 (8 Running, 0 Paused, 0 Stopped)",
"updatedAt": "2017-01-17T06:34:10Z"
}
]
Please point to document where i can learn more about it 请指出我可以在哪里了解更多相关信息
Actually your question is not related to Spark-Java and just a java question. 实际上你的问题与Spark-Java无关,只是一个java问题。 for more information: simplest way to read json from a URL in java
有关更多信息: 从java中的URL读取json的最简单方法
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.