Convert Curl to Java equivalent
问题 I'm working with New Relic REST API for the first time, I have a curl command: curl -X GET 'https://api.newrelic.com/v2/applications/appid/metrics/data.json' \ -H 'X-Api-Key:myApiKey' -i \ -d 'names[]=EndUser/WebTransaction/WebTransaction/JSP/index.jsp' I want to send this command in a java servlet and get a JSON object from the response ready for parsing, What is the best solution? HttpURLConnection? Apache httpclient? I've tried a few different solutions, but nothing has worked so far and