I'm using Android Studio Electric Eel | 2022.1.1 for a school project and I need to use an API.
In order to use the API I need to send an HTTP request to a certain URL.
I read about java 11's HttpClient
and HttpRequest
from the package java.net.http
and tried to use it but the android studio can't seem to find this package and puts the error:
error: package java.net.http does not exist import java.net.http.HttpClient;
I tried checking why it may show this error and I checked the gradle jdk version but it shows that it is version 11.