I need to send a large data class over Http request. Here is my class:
data class User(
val uid: String,
val mobNum: String,
val isValidated: Boolean,
val isActivated: Boolean,
val gender: String,
...
...
...)
Here is the Api service I use for updating a part of this data. If needed.
internal interface ProfileApi {
@POST("update/profile")
@FormUrlEncoded
fun updatePending(
@Field("_id") uid: String,
@Field("mobile_num") mobNum: String,
@Field("is_validated") isValidated: Boolean,
@Field("is_activated") isActivated: Boolean,
@Field("gender") gender: String,
.....
....
): Call<ResponseClass>
}
But this time I need to send request of all 50 or more fields. How can I map data-keys to field-keys and corresponding value with @FieldMap or any other method. thanks.