Here is my JSONArray Response from Web service:
[
{
"sponsors": [
{
"leg_id": "NYL000067",
"typ
Please try to use this one
@FormUrlEncoded
@POST("api/sponsors")
Call> getStatesAndDistrict(
@Field("xyz") String field1
);
Call > call = service.getSponsorsValue();
call.enqueue(new Callback>() {
@Override
public void onResponse(Call> call, Response> response) {
List rs = response.body();
}
@Override
public void onFailure(Call> call, Throwable t) {
}
});
class SponsorsResult {
@SerializedName("sponsors")
private List sponsors;
public List getSponsors() {
return sponsors;
}
}
class SponsorsValue{
@SerializedName("leg_id")
@Expose
private String legId;
@SerializedName("type")
@Expose
private String type;
@SerializedName("name")
@Expose
private String name;
public String getLegId() {
return legId;
}
public void setLegId(String legId) {
this.legId = legId;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
Please let me know if you are facing any issue.