title: Invalid type in JSON write (NSConcreteData)?
body: <p>I am using AFNetworking to post an audio with some data. I am getting following exception.</p>
  
  <pre><code>*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Invalid type in JSON write (NSConcreteData)'
  </code></pre>
  
  <p>I am using this code..</p>
  
  <pre><code>dict=@{@"access_token":[defaults valueForKey:@"TOKEN"],@"email":email,@"prayer":passData};
  
  if ([NSJSONSerialization isValidJSONObject:dict]) {
          NSLog(@"Proper JSON Object");
  
      }
      NSError *error;
      NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dict options:NSJSONWritingPrettyPrinted error:&amp;error];
  
      NSURL *URL = [NSURL URLWithString:url];
      NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:URL
                                                             cachePolicy:NSURLRequestReloadIgnoringCacheData  timeoutInterval:10];
  
      [request setHTTPMethod:@"POST"];
      [request setValue: @"application/json" forHTTPHeaderField:@"Content-Type"];
      [request setHTTPBody:jsonData];
   AFHTTPRequestOperation *op = [[AFHTTPRequestOperation alloc] initWithRequest:request];
      op.responseSerializer = [AFJSONResponseSerializer serializerWithReadingOptions:NSJSONReadingAllowFragments];
      [op setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {}
  </code></pre>
  
  <p>I need to post values in this format</p>
  
  <pre><code>{
      "access_token" = 2cf0d8a66654fa4f;
      email = "";
      prayer =     {
          audio = &lt;63616666 00010000 64657363 00000000 00000020 40e58880 00000000 696d6134 00000000 00000044 00000040 00000002 00000000 6b756b69 00000000 00000000 66726565 0000000&gt;
   98903013 31faae9c bb7b0780 80808080&gt;;
          "category_id" = "";
          description = "";
          "expired_date" = "Expiration Date";
          "is_audio" = 1;
          "is_urgent" = 0;
          "prayer_access_id" = "";
          "prayer_type_id" = 1;
          subject = "";
      };
  }
  </code></pre>
  
  <p>I don't know why this is happening, I have posted values before with this format but when I try to post audio as data, I am getting this exception.
  Thanks in advance</p>
  
  <p><strong>Edit</strong> </p>
  
  <p>Here i am making data</p>
  
  <pre><code> NSData *audioFile=[self audioData];
   if (audioFile==nil) {
          [passData setObject:@"" forKey:@"audio"];
          [passData setObject:@"0" forKey:@"is_audio"];
  
      }else{
  
          [passData setObject:audioFile forKey:@"audio"];
          [passData setObject:@"1" forKey:@"is_audio"];
      }
  
  
  -(NSData *)audioData{
      NSArray *dirPaths = NSSearchPathForDirectoriesInDomains(
                                                              NSDocumentDirectory, NSUserDomainMask, YES);
      NSString *docsDir = [dirPaths objectAtIndex:0];
      NSString *soundFilePath = [docsDir
                                 stringByAppendingPathComponent:@"recordTest.caf"];
  
      NSURL *url = [NSURL fileURLWithPath:soundFilePath];
      NSData *audioData=[NSData dataWithContentsOfURL:url];
      return audioData;
  }
  </code></pre>
  
  <p>this what i am inserting audio file</p>