I am trying to use the GET in my HTML page to return the contents of the textbox in the URL
My browser shows the correct URL after I press submit button
http://192.168.0.101:5555/ok?fname=123&lname=abc
where 123 & abc are the contents are the contents of the two text boxes
But the server never gets back the URL.
It truncates on the ?
Here is the code
My logs show I am not catching anything in Get either, I have also tried Post and the results are the same
These are the logs
Client: 192.168.0.102
Get RequestURI=/ok
Get Method=GET
Get GET=
Get POST=
Get MSG=
My browser shows the correct URL after I press submit button
http://192.168.0.101:5555/ok?fname=123&lname=abc
where 123 & abc are the contents are the contents of the two text boxes
But the server never gets back the URL.
It truncates on the ?
Here is the code
B4X:
Sub Server_HandleRequest (Request As ServletRequest, Response As ServletResponse)
Log("Client: " & Request.RemoteAddress)
Log("Get RequestURI=" & Request.RequestURI) 'handle the request based on the URL
Log("Get Method=" & Request.Method) 'handle the request based on the URL
Log("Get GET=" & Request.GetParameter("GET")) 'handle the request based on the URL
Log("Get POST=" & Request.GetParameter("POST")) 'handle the request based on the URL
Log("Get MSG=" & Request.GetParameter("message"))
Select True
Case Request.RequestURI = "/set"
Response.SendString("<!DOCTYPE html><html><body><form action='/ok' method='get' target='_blank'>First name: <input Type='text' name='fname'><br>Last name: <input Type='text' name='lname'><br><input Type='submit' value='Submit'><br></form></body></html>")
Case Request.RequestURI = "/ok"
Response.SendString("<!DOCTYPE html><html><body><p>" & "All OK" & "</p></body></html>")
Case Else
Log("Something went wrong")
End Select
End Sub
My logs show I am not catching anything in Get either, I have also tried Post and the results are the same
These are the logs
Client: 192.168.0.102
Get RequestURI=/ok
Get Method=GET
Get GET=
Get POST=
Get MSG=