I used this method to POST an image to server before, but it's a little complicated because I have to add header and boundary by myself. Yesterday I found a project called Resty - "A simple Objective-C HTTP client for iOS and Mac". However, after reading all of its documents, I can't find any method to upload an image file. Please help, thanks so much.
NSMutableDictionary *params = [NSMutableDictionary dictionary];
[params setObject:@"this is a title" forKey:@"title"];
// ***How can I add an image by Resty?***
[params setObject:UIImageJPEGRepresentation(self.image, 1.0) forKey:@"image"];
LRRestyClient *client = [LRResty client];
[client setUsername:userId password:userToken];
[client post:APIImageUrl payload:params withBlock:^(LRRestyResponse *response){
NSLog(@"Done");
}];