Pradeep Rawat

Pradeep Rawat

  • NA
  • 286
  • 8.2k

how to handle api response.

Feb 9 2021 7:49 AM
here "additionalInfo" field is "" blank basically its a array formate...but sometimes its coming "", how will handle this.
 
actual response formate is
 
"bill":{
"additionalInfo":[
{
"name": "Pena",
"value": "100.20"
}
],
"amount": "",
"billDate": "",
"billNumber": "",
"billPeriod": "",
"customerName": "Evelyn JADHV",
"dueDate": "2020-08-22"
},
 
but it comes like that from api
 
data": {
"bill": {
"additionalInfo": "",
"amount": "",
"billDate": "",
"billNumber": "",
"billPeriod": "",
"customerName": "",
"customerRefId": "01517476646",
"dueDate": ""
},
}
 
my classes
  1. public class GetBillFatchedBilldata  
  2. {  
  3. public bill bill { getset; }  
  4. }  
  5. public class bill  
  6. {  
  7. public List<additional> additionalInfo { getset; }  
  8. public string amount { getset; }  
  9. public string billDate { getset; }  
  10. public string billNumber { getset; }  
  11. public string billPeriod { getset; }  
  12. public string customerName { getset; }  
  13. public string customerRefId { getset; }  
  14. public string dueDate { getset; }  
  15. }  
  16. public class additional  
  17. {  
  18. public string name {getset;}  
  19. public string value {getset;}  
  20. }  

Answers (6)