Skip to main content
100%

Java basic http client API Geo (Java 11+)

✓ Published0🌍 Public
TThomasG77
Last edited Feb 8, 2023
Created on Feb 8, 2023

This example shows how to query the French administrative geography API (geo.api.gouv.fr) for commune data, specifically searching for “Montpellier” and printing each matching commune’s name, code, department, SIREN, EPCI, and population to the console. It uses the Java 11 `java.net.http.HttpClient` to send an asynchronous request, `HttpRequest` and `HttpResponse` to handle the HTTP/2 call, and the external JSON-java library (`org.json.JSONArray` and `JSONObject`) to parse the JSON response. The code demonstrates a minimal, non-visual data-fetching workflow rather than a graphical chart.

AI-generated description

Similar vizzes