Objective c - Send an image over http POST
I'm trying to understand how to send an image with http POST and my current client-server protocol design. All the messages from client to server looks like the example below, there is a cmd string with parameter cmd and some more relevant parameters for the command. For example this is how i send a text message to the server: - (void)sendMessagesWithText:(NSString *)text fromUser:(NSString *)userId { NSString *url = SERVER_URL; NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease]; [request setURL:[NSURL URLWithString:url]]; [request setHTTPMethod:@"POST"];