I am implementing login feature and for that using Post request but i am getting error saying
\"retrofit.RetrofitError: com.squareup.okhttp.interna
Try using this
public interface SafeUserApi {
@FormUrlEncoded
@POST("/api/userlogin")
void getUserLogin(
@Field("client_id") String id,
@Field("client_secret") String secret,
@Field("username") String uname,
@Field("password") String password,
Callback cb
);
}
Here parm1 is the POST parameter that you will be passing it to the server. This will solve your problem
in case if you are using PHP u can access the param1 using $uname= $_POST('username');
EDIT 1:
retrofit 2.0 version:
public interface SafeUserApi {
@FormUrlEncoded
@POST("/api/userlogin")
Call getUserLogin(
@Field("client_id") String id,
@Field("client_secret") String secret,
@Field("username") String uname,
@Field("password") String password
);
}