Actually i have json parameter
[dictionary setObject:_dateOfBirth.text forKey:@"birth_date"];
[dictionary setObject:_tfCountry.text forKey:@"country"];
[dictionary setObject:_tfEmail.text forKey:@"email"];
[dictionary setObject:@"" forKey:@"fromLogin"];
[dictionary setObject:@1 forKey:@"gender"];
[dictionary setObject:@"signup" forKey:@"methodName"];
[dictionary setObject:_tfContact.text forKey:@"mobile"];
[dictionary setObject:_tfName.text forKey:@"name"];
[dictionary setObject:_tfNickName.text forKey:@"nickname"];
[dictionary setObject:_tfPassword.text forKey:@"password"];
[dictionary setObject:_tfPinCode.text forKey:@"pincode"];
There Is also a Image that i have to set profile_pic as a Key. Now I have Converted all Parameter as a data and POst That Data lie This
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dictionary options:kNilOptions error:nil];
// this is your service request url
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://proteen2.inexture.com/webservice"]];
// set the content as format
[request setHTTPMethod:@"POST"];
[request setHTTPBody: jsonData];
// this is your response type
[request setValue:@"application/json;charset=UTF-8" forHTTPHeaderField:@"content-type"];
NSError *err;
NSURLResponse *response;
// send the synchronous connection
NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&err];
// here add your server response NSJSONSerialization
NSArray *jsonArray = [NSJSONSerialization JSONObjectWithData:responseData options: NSJSONReadingMutableContainers error: &err];
It's Works fine for Text, Now how to attach Image to that Parameter, I am only aware with Multi Part but not getting that Point. Please Help