how do i create a search function. where I can search a make and it gives me all the related models? how do i integrate this into my code using its api keys etc. below is something close to what im looking for
public static ApiResponse getDataFromAPIQuick(String searchName) {
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(“https://car-data.p.rapidapi.com/cars?limit=25&page=0&make=”+ searchName))
.header(“X-RapidAPI-Key”, “b57e9e276fmsh1f36cc4d7866312p116353jsn1cd48ceedd7e”)
.header(“X-RapidAPI-Host”, “car-data.p.rapidapi.com”)
.method(“GET”, HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
הצטרף לדיון - הוסף תגובה למטה: