Q:

Does HttpURLConnection work for sdk22?

Does HttpURLConnection that works for android API 23 also work for android API22?
I'm trying to program for android version over 4.0.
I am unsure if the difference between sdk22 and sdk23 will cause a problem
// http client
URL url = new URL(url1);
HttpURLConnection httpClient = (HttpURLConnection) url.openConnection();
httpClient.setRequestMethod("POST");
httpClient.setUseCaches(false);
httpClient.setDoInput(true);
httpClient.setDoOutput(true);
httpClient.setRequestProperty("Connection", "Keep-Alive");
httpClient.addRequestProperty("Content-length", reqEntity.getContentLength() + "");

OutputStream os = httpClient.getOutputStream();
reqEntity.writeTo(httpClient.getOutputStream());
os.close();
httpClient.connect();

if (httpClient.getResponseCode() == HttpURLConnection.HTTP_OK) {
  return readStream(httpClient.getInputStream());

A:

Yes it will work without any issues, and the difference will not cause any problem 
HttpUrlConnection is available in from API Level 1 , you can further get more insight from the docs.
Its a good practice to use HttpUrlConnection over deprecated Apache HttpClient classes,

