when http response code is different from 200, it throws a HttpProtocolException which allows for getting the response code in an easier way than parsing the IOException throw before