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

后端 未结 4 1382
名媛妹妹
名媛妹妹 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:09

    Your rest url must be something like this - http://localhost:8080/yourRest/restMethod .
    Instead of localhost url connect your mobile and local machine on same network(wifi network). Get the ip address of your local machine e.g 192.168.1.X ...so now your end point url for rest will be http://192.168.1.X:8080/yourRest/restMethod

提交回复
热议问题