I can not figure out how to do it.
Call<RequestBody> call = mService.postToken(post); call.enqueue(new Callback<RequestBody>() { @Override public void onResponse(@NonNull Call<RequestBody> call, @NonNull Response<RequestBody> response) { if (response.isSuccessful() && response.body() != null) { // вот здесь что-то нужно прописать, но я не знаю } } @Override public void onFailure(@NonNull Call<RequestBody> call, @NonNull Throwable t) { } }); This is pojo
public class RequestBody implements Serializable { @SerializedName("id_token") @Expose private String idToken; public RequestBody(String idToken) { super(); this.idToken = idToken; } public String getIdToken() { return idToken; } public void setIdToken(String idToken) { this.idToken = idToken; } }
And this is the interface:
@FormUrlEncoded @POST(" ") Call<List<RequestBody>> postParams(@Field("id_token") String id_token); How to write this id_token into a String variable?