I have created an endpoint of an API using the FastAPI module of Python. Now I'm accessing the API endpoint using the URL "http://127.0.0.1:8000/predict?age=12&sex=M". After this, I used the IP Address 10.0.2.2 (URL: "http://10.0.2.2/predict?age=12&sex=M") to access this API from the Android emulator inside the Android studio. In both scenarios, the API is working fine and giving a valid response. Now I'm trying to access this API endpoint from my physical Android device with my laptop's IPv4 Address (URL : "http://<My IPv4 address>/predict?age=12&sex=M") and getting null in response. So please do let me know any suggestions and solutions to solve this issue.
My laptop and Mobile phone are both connected to the same wifi network.