It seems that there are no objective-c libraries that you can import that are equivalent to the apache libraries android for android.
So what is the best way to send a video file to server from an iOS app if I'd like to use the same php POST script?
If I use NSMutableRequest
, how can I emulate the multipartentity? Would the following blocks of code be equivalent?
multipartentity.addpart("file", new FileBody(file));
mulitpartentity.addpart("form_submitted", new StringBody("true"));
&
NSMutableData *body = [NSMutableData data];
NSMutableString *str = [[NSMutableString alloc] init];
[str appendFormat:@"file=%@", self.fileData];
[str appendFormat:@"&form_submitted=%@", @"true"];
[body appendData:[postString dataUsingEncoding:NSUTF8StringEncoding]];
[theRequest setHTTPBody:body];