1
0
Files
mineplex-crepe/Plugins[Modified]/Mineplex.BungeeRotator/src/mineplex/bungee/api/ApiGetCall.java

34 lines
727 B
Java
Raw Normal View History

2023-05-19 13:10:36 +07:00
package mineplex.bungee.api;
import java.lang.reflect.Type;
import org.apache.http.client.methods.HttpGet;
import com.google.gson.Gson;
public class ApiGetCall extends DnsMadeEasyApiCallBase
{
private String _action;
public ApiGetCall(String apiUrl, int domainId, String category, String action)
{
super(apiUrl, domainId, category);
_action = action;
}
public void Execute()
{
HttpGet request = new HttpGet(ApiUrl + DomainId + Category + _action);
execute(request);
}
public <T> T Execute(Type returnType)
{
HttpGet request = new HttpGet(ApiUrl + DomainId + Category + _action);
String response = execute(request);
return new Gson().fromJson(response, returnType);
}
}