Website URL
https://smart-parking.freehosting.dev/
Error Message
Hello InfinityFree Community,
I am building a Smart Parking System using an ESP32, and my website is hosted on InfinityFree.
Website: https://smart-parking.freehosting.dev/
API endpoint: https://smart-parking.freehosting.dev/esp32_api.php
When I open the API URL in my browser, it returns JSON:
{“success”:false,“message”:“Unauthorized”}
However, when my ESP32 sends an HTTP POST request with a JSON body and an X-API-Key header, the response is HTTP 200 containing an HTML page with /aes.js and JavaScript that attempts to set a __test cookie.
My ESP32 cannot execute this JavaScript, so it cannot receive the JSON response required for my project.
I would like to keep my website and database on InfinityFree.
Could someone explain whether direct ESP32 requests to PHP API endpoints are supported on free hosting, and what supported solution I can use?
Thank you.
Other Information
I am using an ESP32 board with Arduino IDE for my Smart Parking System. My website uses PHP and MySQL and is hosted on InfinityFree.
The API works in my laptop browser and returns JSON, but requests from the ESP32 receive HTTP 200 with an HTML JavaScript security challenge containing /aes.js instead of JSON.
My ESP32 sends a JSON POST request with an X-API-Key header. I want to keep my existing InfinityFree website and database.
I have not confirmed whether the security challenge can be resolved on my current hosting plan. I would appreciate guidance on supported solutions for ESP32-to-PHP API communication.