I am writing an android application which uses HttpURLConnection for downloads. I am wondering what the getResponseMessage() method returns. If I make a successful (200 OK) request, will it return the same thing as the data given by getInputStream() ? What will it return if my request receives a non-200 status code?
It will return an HTTP response message. Have a look here http://en.m.wikipedia.org/wiki/List_of_HTTP_status_codes
Like the famous 404 Not Found
.
The docs clearly say:Returns the response message returned by the remote HTTP
It doesn't return the data you want to retrieve. It gives you information about your connection.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With