Search in sources :

Example 11 with RequestResponse

use of de.foryasee.httprequest.RequestResponse in project Rubicon by Rubicon-Bot.

the class MojangUtil method fetchNameHistory.

private String fetchNameHistory(String uuid) {
    HttpRequestBuilder request = new HttpRequestBuilder("https://api.mojang.com/user/profiles/" + uuid + "/names", RequestType.GET);
    RequestResponse response = null;
    try {
        response = request.sendRequest();
    } catch (Exception e) {
        e.printStackTrace();
    }
    if (response.getResponseCode() != 200)
        return null;
    return response.getResponseMessage();
}
Also used : HttpRequestBuilder(de.foryasee.httprequest.HttpRequestBuilder) RequestResponse(de.foryasee.httprequest.RequestResponse) ParseException(org.json.simple.parser.ParseException)

Aggregations

RequestResponse (de.foryasee.httprequest.RequestResponse)11 HttpRequestBuilder (de.foryasee.httprequest.HttpRequestBuilder)10 JSONObject (org.json.simple.JSONObject)7 JSONParser (org.json.simple.parser.JSONParser)5 ParseException (org.json.simple.parser.ParseException)4 JSONArray (org.json.simple.JSONArray)3 EmbedBuilder (net.dv8tion.jda.core.EmbedBuilder)2 RequestHeader (de.foryasee.httprequest.RequestHeader)1 Date (java.util.Date)1 HTTPException (javax.xml.ws.http.HTTPException)1 JSONObject (org.json.JSONObject)1