Performs a get on urlAsString using username and password as credentials.
If the status code returned not -1 and 401 then the contents are returned. If the status code is 401 an
AuthenticationException is thrown.
All other values of status code are not dealt with but logic can be added as needed.