I am trying to add an Image into my JSON file that I want to post on the server. I am using the following code but I keep on getting Invalid type in JSON write (NSConcreteMutableData)
error. The code is
NSDictionary *parameter = [[NSDictionary alloc]init];
NSData *imageData = UIImagePNGRepresentation(imageView.image);
parameter = @{@"body":@"Hi",@"image":imageData};
Also, I am using AFNetworking
to post the image to the server
I am not sure what is wrong in the code. Any help would be highly appreciated