# Flutter Android API requests return a JavaScript challenge instead of JSON

**URL:** <https://forum.infinityfree.com/t/flutter-android-api-requests-return-a-javascript-challenge-instead-of-json/121995>\
**Category:** Hosting Support\
**Created:** [November 16, 2026, 6:48pm UTC](https://forum.infinityfree.com/t/flutter-android-api-requests-return-a-javascript-challenge-instead-of-json/121995 "2026-11-16T18:48:54Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Lemni](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/lemni/32/68303_2.png) [@Lemni](https://forum.infinityfree.com/u/Lemni)\
**Post date:** [November 16, 2026, 6:49pm UTC](https://forum.infinityfree.com/t/flutter-android-api-requests-return-a-javascript-challenge-instead-of-json/121995/3 "2026-11-16T18:49:10Z")

</div>

_Beep boop, I’m a bot! I dug through the forum to get you started. I sometimes get things wrong though, so do with this what you will until a human has a look._

Unfortunately, this can’t be turned off. The URL is fine, but the check will block your Flutter app.

Every free hosting account has a browser security check. It only lets through clients that can run JavaScript and keep cookies. A Flutter app’s HTTP client can’t do either. It gets a short HTML page that loads `/aes.js` instead of your JSON. The guide says the check covers every URL on the site. It can’t be turned off for one path, such as `/index.php/api/*`, or for one user agent or IP address. Using your own domain doesn’t change that. The API root probably looks fine because you opened it in a browser, which passes the check.

So your Flutter app can’t call a PHP API hosted on a free InfinityFree account. The guide’s own list of what doesn’t work includes Android apps and REST APIs. Its page on mobile apps says the options are to move to [premium hosting](https://www.infinityfree.com/premium/), which doesn’t have this restriction, or to redesign the app so it doesn’t fetch data directly from your free site.

Here is the guide on the security system:

> [@Browser Security System - Features and Limitations](https://forum.infinityfree.com/t/browser-security-system-features-and-limitations/49353):
>
> InfinityFree uses a security system on all free hosting accounts to ensure your website is accessed by real web browsers, not bots or automated scripts. While this protects your site from malicious traffic, it can affect certain types of access. How the security system works The system checks that visitors can execute JavaScript and accept cookies: features that all modern web browsers support. This verification happens automatically and most website visitors will never notice it. You may occa…

Here is the article on mobile apps:

> [@Why won't my mobile app connect to my website?](https://forum.infinityfree.com/t/why-wont-my-mobile-app-connect-to-my-website/115197):
>
> If you’re trying to connect a mobile app to your InfinityFree website and it’s not working, this is likely due to our browser security system that’s required on all free hosting accounts. What’s happening? InfinityFree uses a security system that requires JavaScript and cookies to access websites. This system works perfectly with mobile web browsers, but mobile apps typically can’t execute JavaScript or store cookies the way browsers do. When your app tries to connect, it gets blocked by the s…

---

_[View the full topic](https://forum.infinityfree.com/t/flutter-android-api-requests-return-a-javascript-challenge-instead-of-json/121995)._
