The Android app needs to send HTTPS POST requests containing JSON data to my PHP API endpoint

Website URL

https://sabisale.free.je

Error Message

Hello InfinityFree Support Team,

I am developing a Nigerian business management SaaS called SabiSale, hosted on InfinityFree.

Website: https://sabisale.free.je/public/index.php

I am currently developing an Android application for a Moniepoint P8 POS terminal. The Android app needs to send HTTPS POST requests containing JSON data to my PHP API endpoint:

https://sabisale.free.je/public/api/device-pair.php

When the Android application calls this endpoint, it receives an HTML response containing “/aes.js” instead of the JSON response expected from my PHP script.

The endpoint is intended to return JSON responses for device pairing. The same issue also prevents me from testing the API properly with cURL.

Could you please clarify:

  1. Does InfinityFree’s free hosting security system block direct API requests from Android applications?
  2. Is there any supported way to allow direct JSON POST requests to my API endpoint without the JavaScript browser challenge?
  3. If this is not supported on the free plan, is upgrading to premium hosting the only way to make my Android application communicate reliably with the PHP API?

I would appreciate your guidance because I would prefer to continue using InfinityFree if this functionality is supported.

Thank you.

Other Information

pls help me out

Welcome to the InfinityFree community forum! Good to have you here.

  • Most people answering here are volunteers. They’re often the fastest source of help. Admin (the only staff member) checks in about once a day for issues on our end.
  • Volunteers can’t see your account or website. Share what you actually see, like error messages and what happens when you try something. That’s more useful than your theory of what’s wrong.
  • AI tools often get InfinityFree wrong. If a volunteer’s advice differs from what an AI told you, please try the volunteer’s suggestion first.
  • Solving an issue is a joint effort. Try the suggestions you get and report back what happened.

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.

Yes, the security system is what’s stopping your Android app and cURL. The /aes.js page you get back is the free hosting browser check. Your request never reaches your PHP script.

Our knowledge base article says the check requires JavaScript and cookies. A tool or app that can’t run it gets a short HTML page that loads /aes.js, and the article lists Android and iOS apps, REST APIs and cURL as things that won’t work. To your three questions:

  1. Does it block direct API requests from Android apps? Yes. The article says Android apps can’t connect to a site on free hosting, and that REST APIs and command-line tools like cURL are affected too.
  2. Is there a supported way to skip the challenge? No. It covers every URL on the site and can’t be excluded for one path, file type, user agent or IP address. A custom domain doesn’t change this either, and it can’t be disabled on free hosting.
  3. Is premium hosting the only way? The article’s answer is premium hosting, which it says protects the site with less restrictive methods and lets mobile apps, APIs and automated tools work normally.

Here’s the article, with all the details:

Someone else asked almost the same thing a few days ago, for an Android chat app calling a PHP API. The knowledge base article above is the better source.

  1. Yes (for non-browser connections)
  2. I think you can’t
  3. In premium hosting, there are no browser challenge so yes