import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.Scanner;
public class PrincipalComBusca {
public static void main(String[] args) throws IOException, InterruptedException {
Scanner leia = new Scanner(System.in);
System.out.println("Digite um filme para Busca:");
var busca = leia.nextLine();
String endereco = "https://www.omdbapi.com/?t=" + busca + "&apikey=chave";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
/* .uri(URI.create("https://www.omdbapi.com/?t=matrix&apikey=chave")), mudamos para uma forma dinamica.*/
.uri(URI.create(endereco))
.build();
HttpResponse<String> response = client
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}