Android Question HttpJob and Codeigniter

equibubble

New Member
Licensed User
Longtime User
Loving B4A, so powerful, will be purchasing the full version as soon as I get paid as a priority.

Now for my question, I am trying to communicate with the database of my website. The website is written in Codeigniter and due to the load balancing in place, the domain may hit one of several servers and therefore one of several backend mysql servers.

I have written a controller to handle requests coming from the app, all tested and working ok. My problem comes from the app.

I have the following command:
job.PostString("http://www.<mywebsitehere>.co.uk/index.php/<controllerhere>/login/", Query)
and have also tried:
job.PostString("http://www.<mywebsitehere>.co.uk/<controllerhere>/login/", Query)

Login is obviously the function within the controller.

Both work fine from my browser, but do not work within the app (get a 503). I can only assume it is something to do with the URL.

And advice, much appreciated.
 

equibubble

New Member
Licensed User
Longtime User
oh, must add:

when I wrote and standalone file on the server to access the mysql db (so worked around codeigniter) everything worked ok, but due to the load balancing, I must have it work through codeigniter.
 
Upvote 0

equibubble

New Member
Licensed User
Longtime User
ok, I managed to fix it myself, so posting solution for others (unless anyone can pose a better solution)

Instead of using poststring, used download2 instead.
 
Upvote 0

Cre8ive

New Member
Licensed User
Longtime User
Job.PostString sends a POST request. Your service requires a GET request (same as the request sent by the browser when you enter an address).
Hi Erel,

When I switched from PostString to Download2, I also changed the receiving PHP file from Post to Get, at the same time as I noticed this in the documentation.

p.s. I was equibubble; registered a new user Cre8ive when I purchased the software.
 
Upvote 0
Top