Is this the correct way to return an int from a server response?
public static int getRequest2(String url) {
String intresponse = "";
int result = Integer.parseInt(intresponse);
try {
intresponse = Request.Get(url).execute().returnContent().asString();
} catch (IOException ex) {
ex.printStackTrace();
}
return result;
}
static int urlr(){
return getRequest2("http://random.com");
}
I'm used to return string response, I'm a little lost on how to convert it. I tried to convert the string into an int.