title: convert NSMutableDictionary to JSON and string
body: <p>I want to add a json data to HTTPBody request for an iOS app.
  I am using objective c.
  So I decided to use <code>NSMutableDictionary</code> to convert it to JSON
      @property NSMutableDictionary* project;</p>
  
  <p>Parameters:
       project (required): a hash of the project attributes, including:
       name (required): the project name
       identifier (required): the project identifier
       description
  This is the JSON format when adding data as a raw:
  If I want the JSON to look like this, do I have to create NSMutableDictionary object and have another NSMutableDictionary object inside it with the key name <code>@"project"</code>?</p>
  
  <pre><code>{
      "project": {
          "name": "",
          "identifier": "example",
          "description": "",
      }
  }
  </code></pre>
  
  <p>I tried to have only one <code>NSMutableDictionary</code> 
  Here is my code:</p>
  
  <pre><code>[self.project setObject:self.projectName.text forKey:@"name"];
  [self.project setObject:self.projectDescription.text forKey:@"description"];
  [self.project setObject:self.projectIdentifier.text forKey:@"identifier"];
  </code></pre>
  
  <p>Here is how to convert it to JSON:</p>
  
  <pre><code>NSData *data = [NSJSONSerialization dataWithJSONObject:project options:NSJSONWritingPrettyPrinted error:nil];
      NSString* jsonString = [[NSString alloc]initWithData: data
                                                encoding: NSUTF8StringEncoding ];
  NSData* anotherdataobj = jsonString;
      [request setHTTPBody:anotherdataobj];
  </code></pre>
  
  <p>I convert it to <code>NSData</code> again because <code>HTTPBody</code> accept <code>NSData</code> for the parameter.</p>
  
  <p>To be clear:
  1- do i have to create <code>NSMutableDictionary</code> for project and add <code>NSMutableDictionary</code> projectdetails as a value for for its key <code>@"project"</code>
  2- Do I have to convert the string into <code>NSData</code> again to pass it for the <code>HTTPBody</code>?
  Correct me if i'm wrong here?</p>