Hi All,
Here is another problem.
Scenario:
I´m testing HttpUtils.PostString and it works fine when I send an url without parameters.
Before test in b4a, I sent in browser:
http://myip/example.aspx
By default this url, without any parameters, returns:
[{"Col1":"1","Col2":"Laguinho com Ilha do Marcelo Cid"},{"Col1":"11","Col2":"Lago 1 do Tioayres"},{"Col1":"12","Col2":"Laguinho do Guizilini"},{"Col1":"13","Col2":"Laguinho do Edmilson"},{"Col1":"19","Col2":"Laguinho do Fernando Almeida"},{"Col1":"20","Col2":"Laguinho do Alonso"},{"Col1":"21","Col2":"Laguinho do Luís Lavia"},{"Col1":"26","Col2":"Lago do Piccirilli"},{"Col1":"27","Col2":"Lago da Vanessa Elisa"},{"Col1":"29","Col2":"Laguinho do Groo"},{"Col1":"30","Col2":""},{"Col1":"31","Col2":"Laguinho do Silvio Orsolin"},{"Col1":"32","Col2":""},{"Col1":"33","Col2":"laguinho da Rita"},{"Col1":"34","Col2":""},{"Col1":"39","Col2":"AINDA NAO CONSTRUI. DAI TER INICIADO MINHA CONTA"},{"Col1":"40","Col2":"lago da suzana"},{"Col1":"41","Col2":""},{"Col1":"42","Col2":"Laginho do Rodrigo"},{"Col1":"43","Col2":""}]
And when I try this url on b4a, like this:
HttpUtils.PostString("", "http://myip/example.aspx", "")
It works fine too !!
Here is a partial result, in b4a log:
Rows #0
col1=1
col2=Laguinho com Ilha do Marcelo Cid
Rows #1
col1=11
col2=Lago 1 do Tioayres
Rows #2
col1=12
col2=Laguinho do Guizilini
Rows #3
col1=13
col2=Laguinho do Edmilson
Rows #4
col1=19
col2=Laguinho do Fernando Almeida
Now, problems...
Problem 1.
If I pass a parameter to a URL, like this:
HttpUtils.PostString("", "http://myip/example.aspx?query=Select * from Mylake", "")
I receive an error message:
java.lang.IllegalArgumentException: Illegal character in query at index 56:
Problem 2.
I tried the same example, but changing “ “ to %20, like this:
HttpUtils.PostString("", "http://myip/example.aspx?query=Select%20*%20from%20Mylake", "")
And had no errors message, but I doesn´t work, here is log:
Starting Job:
** Activity (main) Resume ** ** Service (httputilsservice) Create ** ** Service (httputilsservice) Start ** ** Service (httputilsservice) Destroy **
Note:
All urls work fine at browser, my aspx page recognizes and work with this 3 types of query:
http://myip/example.aspx?query=Select * from Mylake
http://myip/example.aspx?query=Select * from Mylake
http://myip/example.aspx
At all of tests in browser, there´s a response.write that sends a result mentioned above.
Any ideas to solve problem 1 and problem 2 ?
Thank you.