sendRequest

static T sendRequest<T>(String request, Class<T> returnType)

Sends a request to the server and waits for a response.

Return

the json response from the server, converted to a java class

Parameters

request

the request body (can include the type, params, whatever you want. the server will parse it)

returnType

the return type of the json sent back by the server

<T>

the return type

Throws

if there was an issue getting a response from the server