I need to get the url of the final redirect request cause it contains some variables needed for further actions needed, and which unfortunately are not included in the headers, and of course the location header is null.
I found this:
B4X:
response.request().urlString();
, but if I try to insert this, using jo, I get
B4X:
java.lang.RuntimeException: Method: request not found in: anywheresoftware.b4h.okhttp.OkHttpClientWrapper$OkHttpResponse
.
What may be the correct way of getting the url?
Thank you.
Dim j As HttpJob
j.Initialize("", Me)
j.Download("http://www.b4x.com")
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
Dim jo As JavaObject = j.Response
Dim url As String = jo.GetFieldJO("response").RunMethodJO("request", Null).RunMethod("url", Null)
End If
Dim j As HttpJob
j.Initialize("", Me)
j.Download("http://www.b4x.com")
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
Dim jo As JavaObject = j.Response
Dim url As String = jo.GetFieldJO("response").RunMethodJO("request", Null).RunMethod("url", Null)
End If