DEV Community

Cover image for Send an HTTP GET Request using Java 11 HttpClient
Dan Vega
Dan Vega

Posted on

6 1

Send an HTTP GET Request using Java 11 HttpClient

In this tutorial, you will learn how to make an HTTP request in Java using the HttpClient class from Java 11. This class makes it really easy to send a request and in this demo, you will learn how to call a REST API. The REST API is going to return a JSON array and you will then learn how to convert each item in the array into a Java Object using Jackson.

When you have completed this tutorial you should understand:
✅ What is the HttpClient class and why would you need it
✅ Use Java HttpClient to send an HTTP GET Request
✅ Call a REST Client in Java
✅ Use Jackson Databind to parse JSON into Java Objects
✅ Use a reference method to print out each Java Object

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

Top comments (1)

Collapse
 
nismooooooo profile image
Anton Dreka

Nice tutorial, thx.

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →