我正在开发一个Android应用程序,这是发送一个JSON使用Android Retrofit (它转换一个JSON中的POJO类)。它工作得很好,但在发送JSON时需要忽略POJO类中的一个元素。
有人知道Android Retrofit注释吗?
示例
POJO类:
public class sendingPojo
{
long id;
String text1;
String text2;//--> I want to ignore that in the JSON
getId(){return id;}
setId(long id){
this.id = id;
}
getText1(){return text1;}
setText1(String text1){
this.text1 = text1;
}
getText2(){return text2;}
setText2(String text2){
this.text2 = text2;
}
}
接口发送器ApiClass
public interface SvcApi {
@POST(SENDINGPOJO_SVC_PATH)
public sendingPojo addsendingPojo(@Body sendingPojo sp);
}
你知道如何忽略text2吗?
https://stackoverflow.com/questions/31922250
复制相似问题