How can I access my local REST api from my android device?

后端 未结 4 1381
名媛妹妹
名媛妹妹 2021-02-13 14:03

I have a spring REST api running locally on my computer. I would like to consume this api for android development.

Here is my get request:

public stati         


        
4条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-13 14:15

    Let me tell you an easier way to do this. If you are using Android emulator you can use 10.0.2.2 as the IP address to connect to the host machine where your REST API is available.

    Similarly if you are using Genymotion which uses Oracle Virtualbox, you can use 10.0.3.2.

提交回复
热议问题