Home > Mobile >  Getting a JSON string via the Django API in Android
Getting a JSON string via the Django API in Android

Time:11-30

I'm trying to get a JSON string by JSON with the API. The API is self-made (very simple) on Django. If you open /127.0.0.1:8000/get_last_data in the browser, then everything is displayed.

I tried to run it on the emulator (using /10.0.0.2:8000/get_last_data) I get an error - Failed to connect to /10.0.0.2:8000.

I tried to run on a real device (/192.168.0.104:8000/get_last_data) I get - Failed to connect to /192.168.0.104:8000. I tried using a third-party API - it works.

Tell me what to do? I apologize for my English

CodePudding user response:

You can try port fowarding using ngrok

after installing ngrok and configuring it , on your terminal/cmd run it on your servers port eh ngrok http 8000 it will give you a url you can use.

  • Related