tudorf Active Member Licensed User Longtime User Sep 3, 2012 #1 I make a download from a webside with HttpUtils. url1 = "http://www.geocaching.com/seek/cache_details.aspx?wp=GC3TNVF" If HttpUtils.IsSuccess(url1) Then s = HttpUtils.GetString(url1) The result ist not correct. I must have access with my password. I have modyfy HttpUtilsService.ProcessNextTask and change hc.Execute to hc.ExecuteCredentials. If hc.ExecuteCredentials (req, task, "my_name","Password") = True Then The result of ExecuteCredentials gives true but I have not the right Info. When I load the webside in a Webview then ist the result correct. Can I have a acces to the string from the webview ? Martin Attachments wrong_password.JPG 35.5 KB · Views: 420 correct.JPG 83.7 KB · Views: 442
I make a download from a webside with HttpUtils. url1 = "http://www.geocaching.com/seek/cache_details.aspx?wp=GC3TNVF" If HttpUtils.IsSuccess(url1) Then s = HttpUtils.GetString(url1) The result ist not correct. I must have access with my password. I have modyfy HttpUtilsService.ProcessNextTask and change hc.Execute to hc.ExecuteCredentials. If hc.ExecuteCredentials (req, task, "my_name","Password") = True Then The result of ExecuteCredentials gives true but I have not the right Info. When I load the webside in a Webview then ist the result correct. Can I have a acces to the string from the webview ? Martin
mc73 Well-Known Member Licensed User Longtime User Sep 4, 2012 #2 Searched a bit some code I wrote some time ago. Why do you use this if condition? I think that you can simply write Code: Copy hc.ExecuteCredentials (req, task, "my_name","Password") If the operation fails, the hc_responseError sub will be executed, I think. Upvote 0
Searched a bit some code I wrote some time ago. Why do you use this if condition? I think that you can simply write Code: Copy hc.ExecuteCredentials (req, task, "my_name","Password") If the operation fails, the hc_responseError sub will be executed, I think.
tudorf Active Member Licensed User Longtime User Sep 4, 2012 #3 The Sub hc_ResponseError is a part from the HttpUtilsService-Modul. Sub hc_ResponseError (Response As HttpResponse, Reason As String, StatusCode As Int, TaskId As Int) countWorking = countWorking - 1 finishTasks = finishTasks + 1 HandleError(TaskId, Reason) If Response <> Null Then ' OK or Error Log(Response.GetString("UTF8")) Response.Release End If ProcessNextTask End Sub Which value must habe response ? Martin Upvote 0
The Sub hc_ResponseError is a part from the HttpUtilsService-Modul. Sub hc_ResponseError (Response As HttpResponse, Reason As String, StatusCode As Int, TaskId As Int) countWorking = countWorking - 1 finishTasks = finishTasks + 1 HandleError(TaskId, Reason) If Response <> Null Then ' OK or Error Log(Response.GetString("UTF8")) Response.Release End If ProcessNextTask End Sub Which value must habe response ? Martin
Erel B4X founder Staff member Licensed User Longtime User Sep 4, 2012 #4 The result of Execute and ExecuteCredentials is not related to the server. I recommend you to use HttpUtils2 instead of HttpUtils. If ResponseError event was raised then there was an error. You should check the logs and see the error message. Upvote 0
The result of Execute and ExecuteCredentials is not related to the server. I recommend you to use HttpUtils2 instead of HttpUtils. If ResponseError event was raised then there was an error. You should check the logs and see the error message.