Cannot connect to localhost API from Android app

前端 未结 8 2214
星月不相逢
星月不相逢 2020-12-10 06:47

I am new to Django. I have created an API named http://127.0.0.1:8000/api/update/1/ and it works perfectly in the browser and on the Postman app.

Howev

8条回答
  •  被撕碎了的回忆
    2020-12-10 07:45

    To be able to connect your localhost (I assume you are using emulator, I can edit the answer if not)

    You need to use the following url:

    http://10.0.2.2:8000/
    

提交回复
热议问题