Package io.github.thoroldvix.api
Interface YoutubeClient
public interface YoutubeClient
Responsible for sending GET and POST requests to YouTube.
-
Method Summary
Modifier and TypeMethodDescriptiondefault String
Sends a GET request to the specified URL and returns the response body.Sends a GET request to the specified URL and returns the response body.Sends a POST request to the specified URL and returns the response body.
-
Method Details
-
get
Sends a GET request to the specified URL and returns the response body.- Parameters:
url
- The URL to which the GET request is made.headers
- A map of additional headers to include in the request.- Returns:
- The body of the response as a
String
. - Throws:
TranscriptRetrievalException
- If the request to YouTube fails.
-
post
Sends a POST request to the specified URL and returns the response body.- Parameters:
url
- The URL to which the POST request is made.json
- The JSON body that is sent with a POST request.- Returns:
- The body of the response as a
String
. - Throws:
TranscriptRetrievalException
- If the request to YouTube fails.
-
get
Sends a GET request to the specified URL and returns the response body.- Parameters:
url
- The URL to which the GET request is made.- Returns:
- The body of the response as a
String
. - Throws:
TranscriptRetrievalException
- If the request to YouTube fails.
-