我想知道我是如何使用Retrofit发送一个发布服务器的帖子,其结果是这样的:
{
"facebookProfile":{
"name":"String",
"education_history":"String",
"birthday":"String",
"hometown":"String",
"email":"String",
"location":"String"
},
"picture":{
"selfieURL":"String",
"documentIDs":{
"frontURL":"String",
"backURL":"String"
}
}
}
IDVerification -
public class IDVerification {
private FacebookProfile facebookProfile;
private Customer customer;
private Location location;
private Picture picture;
private Audio audio;
}
FacebookProfile - (有gatter和setter)
public class FacebookProfile implements Serializable{
private String name;
private String education_history;
private String birthday;
private String hometown;
private String email;
private String location;
}
图片 - (有吸气剂和制定者)
public class Picture implements Serializable{
private String selfieURL;
private DocumentIDs documentIDs;
}
答案 0 :(得分:0)
定义以下类:
FacebookProfile
,Customer
,Location
,DocumentIDs
,Picture
,Audio
并定义它们的属性,getter和setter。 Picture
将如下所示:
public class Picture {
private String selfieURL;
private DocumentIDs documentIDs;
public String getSelfieURL() {
return selfieURL;
}
public void setSelfieURL(String selfieURL) {
this.selfieURL = selfieURL;
}
public DocumentIDs getDocumentIDs() {
return documentIDs;
}
public void setDocumentIDs(DocumentIDs documentIDs) {
this.documentIDs = documentIDs;
}
}