Code cleanup: Use HttpURLConnection constants instead of magic numbers

Use the HTTP status codes defined in HttpURLConnection instead of
hardcoding magic integer numbers.