简体   繁体   中英

how to do a get request using java spark

I have to access third part api using java spark

get request http://41.1.1.92:3000/nodes

I just want to know how to access this api using java spark and return the response

when i try to access api response is as shown below

  [
      {
        "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. for more information: simplest way to read json from a URL in java

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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