interface - how to append int value to GET url of retrofit in android -
i have following url http://54.169.227.89:90/dataaccessservice.svc/getproducts/2 wanted use retrofit method how append 2 company id sharepreference during login
here ma interface code
public interface productsget { string company_id = orderapplication.companyid_new; @get("/dataaccessservice.svc/getproducts/") public void getproducts( callback<list<productsnew>> response); }
in order make end point dynamic either can implementing endpoint
, make use of seturl()
or can use url manipulation block surrounded {
, }
.
int company_id = orderapplication.companyid_new; @get("/dataaccessservice.svc/getproducts/{company_id}" public void getproducts( @path("companyid") int companyid,callback<list<productsnew>> response); yourreference.getproducts(company_id,new callback...)
Comments
Post a Comment