M M Zuhri Member Licensed User Aug 12, 2019 #1 Hi all, Can anyone help me, in http job, how to use NetworkCredential. I have use this technique in vb.net and now i need to connect through b4a. 'VB.NET CODE Dim request As WebRequest = WebRequest.Create(Uri.Trim) request.Credentials = New NetworkCredential(Username, Password) .B4A CODE j.Download("http://localhost/api//getdetails") j.Username = "Administrator" j.Password = "456 B4A code gives me error, "ResponseError. Reason: java.net.ConnectException: Failed to connect to localhost/127.0.0.1:57869, Response:" java.lang.Object@307c6d2
Hi all, Can anyone help me, in http job, how to use NetworkCredential. I have use this technique in vb.net and now i need to connect through b4a. 'VB.NET CODE Dim request As WebRequest = WebRequest.Create(Uri.Trim) request.Credentials = New NetworkCredential(Username, Password) .B4A CODE j.Download("http://localhost/api//getdetails") j.Username = "Administrator" j.Password = "456 B4A code gives me error, "ResponseError. Reason: java.net.ConnectException: Failed to connect to localhost/127.0.0.1:57869, Response:" java.lang.Object@307c6d2
Erel B4X founder Staff member Licensed User Longtime User Aug 12, 2019 #2 localhost is wrong. localhost = current device or current emulator. Upvote 0
M M Zuhri Member Licensed User Aug 12, 2019 #3 Yes Erel, after i change it to ip address only it start working... Thanks Upvote 0