'Unable to update the boolean value using retrofit post
I'm trying to make post request using retrofit:
class PostContentModel {
@SerializedName("createdBy")
var createdBy: UserDTO? = null
@SerializedName("postID")
var postID: String? = null
@SerializedName("isMemory")
var isMemory: Boolean?= false
}
@POST("v1/posts")
fun postContent(@Body map: PostContentModel?): Call<ResponseBody>
now in my main activity when i try sending data using retrofit, the createBy and and postID fields are getting updated but the isMemory(boolean) is not getting updated if i set it to true.
val postContentModel: PostContentModel? = PostContentModel()
postContentModel?.createdBy = "xyz"
postContentModel?.postID= "5"
postContentModel?.isMemory= true
ApiCall.postContent(postContentModel)
so now when i check the server the first 2 values have updated but the isMemory is still left at default false value which was preset in the server.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
