@post("api/login") call<apiresponse> loginuser(@body string user);
here string jsonstring i.e.
{"email":"test@gmail.com","password":"test"}
couldnt figure out wrong in this. either string again converted json. please suggest..
this want request shown in picture.
convert data in object
public class credentials { public string email; public string password; }
set data object
credentials logincredentials = new credentials(); logincredentials.email = "test@gmail.com"; logincredentials.password = "password";
call api
@post("api/login") call<apiresponse> loginuser(@body credentials credentials);
Comments
Post a Comment