public class PrincipalComBusca {
public static void main(String[] args) throws IOException, InterruptedException {
Scanner leitura = new Scanner(System.in);
System.out.println("Nome do Filme para pesquisar:");
String endpoint = "https://omdbapi.com/?t=";
String key = "&apiKey=db82e186";
var filmeBusca = leitura.nextLine();
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create( endpoint+filmeBusca+key))
.build();
HttpResponse<String> response = client
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}