Page 1 of 1

Does Httprequest work in an APK for Android

Posted: Wed Mar 11, 2026 9:11 am
by RBart
Thanks to TI-994A I could make a connection to my Mysql server in PureBasic. However in Spiderbasic this seems to be another question. The method looks different. I wanted to do this in an Android app. But the help says "The URL to execute the request. Due to security constraints, it is only possible to execute a request on the same domain" Does this main I can't use httprequest in an android app? Or how do I call the API in another way?

Re: Does Httprequest work in an APK for Android

Posted: Wed Mar 11, 2026 1:00 pm
by RBart
I'm this far now. I can call the API and it works from the spiderbasic IDE. So the spiderbasicscript is not on the same server.
In the api.php file I added.

Code: Select all

header("Access-Control-Allow-Origin: *"); 
header("Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS");
header("Access-Control-Allow-Headers: Content-Type, Authorization");

// preflight requests (OPTIONS)
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
    http_response_code(200);
    exit();
}