问题描述:

Currently I am using the following code to get the response.

public static String LinkCheacker(String URLString) throws IOException {

String Status;

try {

URL url = new URL(URLString);

HttpURLConnection http = (HttpURLConnection) url.openConnection();

http.setRequestMethod("GET");

http.connect();

Status = http.getResponseCode() + ":" + http.getResponseMessage();

http.disconnect();

} catch (Exception e) {

Status = ":some error:" + e.getMessage();

}

return Status;

}

I am having some more API's to test with the authentication (Login with userId, Password), How can I test them ? Please help me on this.

相关阅读:
Top