mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2024-08-14 23:51:41 +00:00
20 lines
530 B
Java
20 lines
530 B
Java
package me.kavin.piped.utils;
|
|
|
|
import me.kavin.piped.consts.Constants;
|
|
import okhttp3.Request;
|
|
|
|
import java.io.IOException;
|
|
|
|
public class RequestUtils {
|
|
|
|
public static String sendGet(String url) throws IOException {
|
|
return sendGet(url, Constants.USER_AGENT);
|
|
}
|
|
|
|
public static String sendGet(String url, String ua) throws IOException {
|
|
|
|
var request = new Request.Builder().header("User-Agent", ua).url(url).build();
|
|
|
|
return Constants.h2client.newCall(request).execute().body().string();
|
|
}
|
|
}
|