Skip to content

Instantly share code, notes, and snippets.

@AbGhost-cyber
Created June 12, 2021 13:19
Show Gist options
  • Save AbGhost-cyber/a4496f90e1bc28cddd6745c10ecedf67 to your computer and use it in GitHub Desktop.
Save AbGhost-cyber/a4496f90e1bc28cddd6745c10ecedf67 to your computer and use it in GitHub Desktop.
private <T> T execute(final Request request, final Class<T> classOfT) throws IOException {
OkHttpClient client = new OkHttpClient();
Response response = client.newCall(request).execute();
return GOSN.fromJson(response.body().string(), classOfT);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment