title: AFHTTPSessionManager post request
body: <p>I want to post a request to server. It is working fine if I am using NSURLSessionDataTask. But underneath I need to use AFNetworking as my whole application is using it. But when I am trying to hit the same service in AFHTTPSessionManager with POST method, It is giving me request time out. </p>
  
  <p>Below are both the codes.</p>
  
  <pre><code>NSError *error;
  
  NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
  NSURLSession *session = [NSURLSession sessionWithConfiguration:configuration delegate:nil delegateQueue:nil];
  NSURL *url = [NSURL URLWithString:@"BASE URL"];
  NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url
                                                         cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                     timeoutInterval:60.0];
  
  [request addValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
  [request addValue:@"application/json" forHTTPHeaderField:@"Accept"];
  
  [request setHTTPMethod:@"POST"];
  
  NSString *postString = @"1";
  
  NSData *data = [postString dataUsingEncoding:NSUTF8StringEncoding];
  [request setHTTPBody:data];
  
  
  NSURLSessionDataTask *postDataTask = [session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
      NSString *str = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
  }];
  
  [postDataTask resume];
  </code></pre>
  
  <p>AFNetworking kit version :- </p>
  
  <pre><code>AFHTTPSessionManager *client = [[AFHTTPSessionManager alloc] initWithBaseURL:[NSURL URLWithString:@"BASE URL"]];
  
  NSDictionary *request = @{@"Content-Type":@"application/json",
                            @"Accept":@"application/json",
                            };
  
  
  NSString *postString = @"1";
  
  NSData *data = [postString dataUsingEncoding:NSUTF8StringEncoding];
  
  
  [client POST:@"" parameters:nil constructingBodyWithBlock:^(id&lt;AFMultipartFormData&gt; formData) {
      [formData appendPartWithHeaders:request body:data];
  } success:^(NSURLSessionDataTask *task, id responseObject) {
      NSLog(@"%@",responseObject);
  } failure:^(NSURLSessionDataTask *task, NSError *error) {
      NSLog(@"%@",error);
  }];
  </code></pre>
  
  <p>Please help me in implementing it in right way.</p>