I getting "Unknown error" as the output for the error string, when i use it in the fetch function

But when i use it in the finished function, am getting "Authentication required".

But i am passing the username and password in the variable converted under http.setUser.

any ideas as to what might be the problem??