I want to send user picture and user’s other information to server using POST method from my iphone application.
my content type is as below
NSString *boundary = [NSString stringWithString:@"--"];
NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@",boundary];
[request addValue:contentType forHTTPHeaderField: @"Content-Type"];
but it is posting only image. my other data is not posting on server.
And if I use below content type then
[ request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"content-type"];
then it is sending other data only. not sending image.
Please suggest me way by which I can send both image and other info.
Use ASIHTTPRequest its simple and easy to use 🙂