NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:20];
[req setHTTPMethod:@"POST"];
[req setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
[req setValue:length forHTTPHeaderField:@"Content-Length"];
[req setHTTPBody:[postData dataUsingEncoding:NSASCIIStringEncoding]];
Well, postData may be an NSString but calling that instance method (dataUsingEncoding:) returns an NSData.Code:[req setValue:length forHTTPHeaderField:@"Content-Length"]; [req setHTTPBody:[postData dataUsingEncoding:NSASCIIStringEncoding]];
The above code is how I am sending my text data, somehow I want to incorporate the image into my postData (which is an NSString)