1

This is my Api and i need to pass values for Passport number Expiry data and other fields i know to pass data when its just normal values. I am not sure how to pass data inside the Dictionary Passport field

{
"CustomerID":0,
"UploadType":"String",
"Passport":
  {
  "PassportNumber":"String",
  "ExpiryDate":"\/Date(-62135596800000-0000)\/",
  "CountryOfIssue":"String",
  "FileName":"String",
  "FileDescription":"String",
  "FileExtension":"String",
  "MimeType":"String",
  "FileData":"AA=="
  },
 "RequestID":"String"
}

I tried this but it didnt work out

NSString *urlString =[NSString stringWithFormat:@"UploadPassport/?CustomerID=%@&UploadType=%@&Passport=&PassportNumber=%@&ExpiryDate=%@&CountryOfIssue=%@&FileName=%@&FileDescription=%@&FileExtension=%@&MimeType=%@&FileData=%@",customerID,uploadType,passportNumber,expiryDate,CountryIssue,fileName,fileDesc,fileExtn,mimeType,fileData];
rmaddy
  • 314,917
  • 42
  • 532
  • 579
iOSDeveloper
  • 461
  • 4
  • 20
  • 1
    Take a look here http://stackoverflow.com/questions/718429/creating-url-query-parameters-from-nsdictionary-objects-in-objectivec – Nathan Hegedus May 22 '14 at 13:48
  • 1
    Based on the question this is linked to, to handle the nested dictionary check if value is a dictionary and recursively call `urlEncodedString`. i.e. `if([value isKindOfClass:[NSDictionary class]]){ [parts addObject:[value urlEncodedString]]; continue; }`. – Joe May 22 '14 at 13:51

0 Answers0