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;
//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
public class Main {
public static void main(String[] args) throws IOException, InterruptedException, IOException {
Scanner lectura = new Scanner(System.in);
System.out.println("Escriba el nombre de una pelicula: ");
var busqueda = lectura.nextLine();
String clave = "dbcee9e8";
String direccion = "https://www.omdbapi.com/?t="+busqueda+"&apikey="+clave;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(direccion))
.build();
HttpResponse<String> response = client
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}