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

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -