title: AFNetworking post image issue in iOS
body: <p>Client ask me to POST some data <code>fields: type, description, email, phone, price, location, photo (file attachment). Mime-Type: multipart/form-data</code> </p>
  
  <p>I have success with all fields except images.</p>
  
  <p>I am using next code:</p>
  
  <pre><code>    UIImage *testImage = [UIImage imageNamed:@"landish.jpeg"];
      NSDictionary *parametres = @{@"type" : @"Suche",
                               @"description" : @"Flowers",
                               @"email" : @"myemail@ya.ru",
                               @"phone" : @"+565124512645",
                               @"price" : @"100",
                               @"location" : @"Gorppingen",
                               @"image" : testImage};
  
      UIImage *image = param[@"image"];
      NSURL *url = [NSURL URLWithString:API_URL_BASE];
      AFHTTPClient *httpClient = [[AFHTTPClient alloc] initWithBaseURL:url];
      NSData *imageData = UIImageJPEGRepresentation(image, 1.0);
      NSMutableDictionary *mutableDict = param.mutableCopy;
      [mutableDict removeObjectForKey:@"image"];
      param = mutableDict;
      NSMutableURLRequest *request = [httpClient multipartFormRequestWithMethod:@"POST"
                                      path:@"anzeigen.php" 
                                      parameters:param 
                                      constructingBodyWithBlock: ^(id &lt;AFMultipartFormData&gt;formData) {
      [formData appendPartWithFileData:imageData name:@"landish" fileName:@"landish.jpeg" mimeType:@"image/jpeg"];
      // etc.
  }];
  
      AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
      [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
          NSString *responseStr = [[NSString alloc] initWithData:responseObject encoding:NSUTF8StringEncoding];
          NSLog(@"Request Successful, response '%@'", responseStr);
          completition (YES);
      } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
          NSLog(@"[HTTPClient Error]: %@", error.localizedDescription);
          completition (NO);
      }];
      [httpClient enqueueHTTPRequestOperation:operation];
  </code></pre>
  
  <p>I send successfully text fields, but image not shown in iPhone, that must work, because from Android app it's sending successfully for the same API, but I cann't talk with that developer</p>
  
  <p>If I try use nil parameters and send only image</p>
  
  <pre><code> NSMutableURLRequest *request = [httpClient multipartFormRequestWithMethod:@"POST" 
                                   path:@"anzeigen.php" 
                                   parameters:nil constructingBodyWithBlock: ^(id &lt;AFMultipartFormData&gt;formData) {
      [formData appendPartWithFileData:imageData name:@"landish" fileName:@"landish.jpg" mimeType:@"image/jpeg"];
      // etc.
  }];
  </code></pre>
  
  <p>I take next in log</p>
  
  <pre><code> 2013-10-23 02:41:26.345 ****[2280:c07] [HTTPClient Error]: Expected status code in (200-299), got 400
  </code></pre>
  
  <p>Maybe you know what I make wrong?</p>