How to ignore some variables in models using for retrofit

前端 未结 3 2049
小鲜肉
小鲜肉 2021-01-12 01:38

I am using Retrofit to send and receive requests to my server.

I Have a model like below and I have to send it to my server but some variables in th

3条回答
  •  日久生厌
    2021-01-12 02:06

    You can use transient keyword to ignore fields when requesting api calls

    JAVA:

    transient String name;
    

    KOTLIN:

    @Transient
    var name: String
    

提交回复
热议问题