title: Upload Using AFNetworking
body: <pre><code>NSURL *url = [NSURL URLWithString:@"http://127.0.0.1:8000/photo/"];
  AFHTTPClient *httpClient = [[AFHTTPClient alloc] initWithBaseURL:url];
  NSDictionary *headers = [NSDictionary dictionaryWithObject:data forKey:@"attachment"];
  //NSLog(@"strimng");
  NSMutableURLRequest *request = [httpClient multipartFormRequestWithMethod:@"POST" path:@"upload/" parameters:nil constructingBodyWithBlock: ^(id&lt;AFMultipartFormData&gt; formData) {
      NSLog(@"strimng");
      [formData appendPartWithFileData:data name:@"attachment" fileName:@"attachment.jpg" mimeType:@"image/jpeg"];
      NSLog(@"strimng");
  }];
  NSLog(@"strimng");
  AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
  [operation setUploadProgressBlock:^(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite) {
      NSLog(@"Sent %lld of %lld bytes", totalBytesWritten, totalBytesExpectedToWrite);
  }];
  [operation start];
  </code></pre>
  
  <p>I am Trying to upload the image from the iphone using AFNetworking, but this is not working.
  The NSLog just before formdata appenddata command is logged out. But the one after that doesnt seem to. I have also checked if NSdata is nil and thats also not the case. And obv the request is not being sent.
  Please can anyone help me.</p>