G gmoriwaki Member Licensed User Jul 16, 2020 #1 I am calling an api with the following syntax: testapi.php?fname=guy How do I call it from download2? I see examples that use the following format: j.download2("http://www.test.com/testapi.php", some array....) I tried the following: j.download2("http://www.test.com/testapi.php", array as string("fname","guy")) When I try to run the application, I get an range or index out of bounds. Am I passing the parameters correctly? Thanks - Guy Last edited: Jul 16, 2020
I am calling an api with the following syntax: testapi.php?fname=guy How do I call it from download2? I see examples that use the following format: j.download2("http://www.test.com/testapi.php", some array....) I tried the following: j.download2("http://www.test.com/testapi.php", array as string("fname","guy")) When I try to run the application, I get an range or index out of bounds. Am I passing the parameters correctly? Thanks - Guy
Douglas Farias Expert Licensed User Longtime User Jul 16, 2020 #2 j.download2("http://www.test.com/testapi.php", array as string("fname","guy")) Click to expand... its right, you must pass a parameter and a value to it. maybe at some point you passed a parameter but forgot the value. Last edited: Jul 16, 2020 Upvote 0
j.download2("http://www.test.com/testapi.php", array as string("fname","guy")) Click to expand... its right, you must pass a parameter and a value to it. maybe at some point you passed a parameter but forgot the value.
G gmoriwaki Member Licensed User Jul 16, 2020 #3 When I copy the following url to the browser: http://testapi.php?fname=guy It returns json data with guy selected. I am trying to do it in b4i using the following: dim j as httpjob j.initialize("",me) j.download2("http://www.test.com/testapi.php", array as string("fname","guy")) ... Here is the error I get when I run/compile: error occured on line: 231(httpjob) Range or index out of bounds ... Upvote 0
When I copy the following url to the browser: http://testapi.php?fname=guy It returns json data with guy selected. I am trying to do it in b4i using the following: dim j as httpjob j.initialize("",me) j.download2("http://www.test.com/testapi.php", array as string("fname","guy")) ... Here is the error I get when I run/compile: error occured on line: 231(httpjob) Range or index out of bounds ...
Douglas Farias Expert Licensed User Longtime User Jul 16, 2020 #4 gmoriwaki said: When I copy the following url to the browser: http://testapi.php?fname=guy It returns json data with guy selected. I am trying to do it in b4i using the following: dim j as httpjob j.initialize("",me) j.download2("http://www.test.com/testapi.php", array as string("fname","guy")) ... Here is the error I get when I run/compile: error occured on line: 231(httpjob) Range or index out of bounds ... Click to expand... your code its right. this example is working here. B4X: Private job As HttpJob job.Initialize("",Me) job.Download2("http://www.example.com", Array As String("key1", "value1", "key2", "value2")) what's after download2? post the entire request and response code if possible. Upvote 0
gmoriwaki said: When I copy the following url to the browser: http://testapi.php?fname=guy It returns json data with guy selected. I am trying to do it in b4i using the following: dim j as httpjob j.initialize("",me) j.download2("http://www.test.com/testapi.php", array as string("fname","guy")) ... Here is the error I get when I run/compile: error occured on line: 231(httpjob) Range or index out of bounds ... Click to expand... your code its right. this example is working here. B4X: Private job As HttpJob job.Initialize("",Me) job.Download2("http://www.example.com", Array As String("key1", "value1", "key2", "value2")) what's after download2? post the entire request and response code if possible.
G gmoriwaki Member Licensed User Jul 16, 2020 #5 Thanks Douglas you were right. I had a debug statement that was dumping the array causing the error. Thanks again!! Upvote 0
Thanks Douglas you were right. I had a debug statement that was dumping the array causing the error. Thanks again!!