I have the following code:
I open the browser so that the user can select his google account. If the user has selected, then I get the response via the url in the browser. How can I retrieve this now with my code?
with this code i get this:
B4X:
fx.ShowExternalDocument(link)
B4X:
Private Sub PrepareServer
If server.IsInitialized Then server.Close
If astream.IsInitialized Then astream.Close
Do While True
Try
server.Initialize(port, "server")
server.Listen
Exit
Catch
port = port + 1
Log(LastException)
End Try
Loop
Wait For server_NewConnection (Successful As Boolean, NewSocket As Socket)
If Successful Then
astream.Initialize(NewSocket.InputStream, NewSocket.OutputStream, "astream")
Dim Response As StringBuilder
Response.Initialize
Log(Response.ToString)
Do While Response.ToString.Contains("Host:") = False
Wait For AStream_NewData (Buffer() As Byte)
Response.Append(BytesToString(Buffer, 0, Buffer.Length, "UTF8"))
Loop
astream.Write(("HTTP/1.0 200" & Chr(13) & Chr(10)).GetBytes("UTF8"))
Sleep(50)
astream.Close
server.Close
Log(Response.ToString)
ParseBrowserUrl(Regex.Split2("$",Regex.MULTILINE, Response.ToString)(0))
End If
End Sub
I open the browser so that the user can select his google account. If the user has selected, then I get the response via the url in the browser. How can I retrieve this now with my code?
with this code i get this:
B4X:
GET / HTTP/1.1