Problem in sending HTTP Post
I am trying to upload image on the server. My webservice needs MemberID. Which I am passing in post1. But while running, it gives error "your webservice requires MemberID." and it fails. Can any one please help me with this? I tried a lot but can not figure out why it is failing.
NSString *post1 =[NSString stringWithFormat:@"memberId=%@",myID];
........
/*
create the body of the post
*/
NSMutableData *body = [NSMutableData data];
[body appendData:[[NSString stringWithFormat:@"rn--%@rn",boundary] dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[[NSString stringWithString:@"Content-Type: application/octet-streamrnrn"] dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[post1 datausingEncoding:NSUTF8StringEncoding]];
[body appendData:[NSData dataWithData:imageData]];
[body appendData:[[NSString stringWithFormat:@"rn--%@--rn",boundary] dataUsingEncoding:NSUTF8StringEncoding]];
// setting the body of the post to the reqeust
[request1 setHTTPBody:body];
|