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;
import static java.net.http.HttpResponse.*;
public static void main(String[] args) throws IOException, InterruptedException {
String url = "http://www.omdbapi.com/?t=";
String keyapi = "&apikey=1d2dc4c6";
Scanner sc = new Scanner(System.in);
System.out.println("Digite o nome do filme: ");
String buscar = sc.nextLine();
String endereco = url+buscar;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(endereco+keyapi))
.build();
HttpResponse<String> response = client
.send(request, BodyHandlers.ofString());
System.out.println(response.body());