Does Httprequest work in an APK for Android

Just starting out? Need help? Post your questions and find answers here.
User avatar
RBart
Posts: 25
Joined: Fri Jul 25, 2025 9:13 am
Location: Belgium

Does Httprequest work in an APK for Android

Post 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?
💻 Exploring the world of SpiderBasic :o
User avatar
RBart
Posts: 25
Joined: Fri Jul 25, 2025 9:13 am
Location: Belgium

Re: Does Httprequest work in an APK for Android

Post 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();
}
💻 Exploring the world of SpiderBasic :o
Post Reply