Question: I'm looking to send an NSDictionary up to a server running Django, and I would prefer if I had to do little or no work writing an encoder/parser.

Is there an easy way to accomplish this task?

Answer: 
iOS 5 has support for it in the framework. Look at NSJSONSerialization. Here is example code for post. Request object creation has been omitted in the code below.

```
NSDictionary *postDict = [NSDictionary dictionaryWithObjectsAndKeys:[NSDictionary dictionaryWithObjectsAndKeys:API_KEY, @"apiKey", userName, @"loginUserName", hashPassword, @"hashPassword", nil], @"loginReq", nil];

[request setHTTPMethod:@"POST"];
[request setValue:@"application/json" forHTTPHeaderField:@"content-type"];
NSError *error = nil;
[request setHTTPBody:[NSJSONSerialization dataWithJSONObject:postDict options:0 error:&error]];

```
iOS doesn't have support to do this as a one-liner, but you could do this:

```
@interface NSString (URLEncoding)

- (NSString *)urlEncodedUTF8String;

@end

@interface NSURLRequest (DictionaryPost)

+ (NSURLRequest *)postRequestWithURL:(NSURL *)url
                          parameters:(NSDictionary *)parameters;

@end

@implementation NSString (URLEncoding)

- (NSString *)urlEncodedUTF8String {
  return (id)CFURLCreateStringByAddingPercentEscapes(0, (CFStringRef)self, 0,
    (CFStringRef)@";/?:@&=$+{}<>,", kCFStringEncodingUTF8);
}

@end

@implementation NSURLRequest (DictionaryPost)

+ (NSURLRequest *)postRequestWithURL:(NSURL *)url
                          parameters:(NSDictionary *)parameters {

  NSMutableString *body = [NSMutableString string];

  NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
  [request setHTTPMethod:@"POST"];
  [request addValue:@"application/x-www-form-urlencoded"
           forHTTPHeaderField:@"Content-Type"];

  for (NSString *key in parameters) {
    NSString *val = [parameters objectForKey:key];
    if ([body length])
      [body appendString:@"&"];
    [body appendFormat:@"%@=%@", [[key description] urlEncodedUTF8String],
                                 [[val description] urlEncodedUTF8String]];
  }
  [request setHTTPBody:[body dataUsingEncoding:NSUTF8StringEncoding]];
  return request;
}

@end

```

Then it's as simple as:

```
NSURL *url = [NSURL URLWithString:@"http://posttestserver.com/post.php"];
NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys:
    [NSNumber numberWithInt:42], @"number",
    @"apple", @"brand", nil];
NSURLRequest *request = [NSURLRequest postRequestWithURL:url parameters:params];
[NSURLConnection sendAsynchronousRequest:request queue:nil completionHandler:nil];

```

Please note that in this example we're not caring about the response. If you care about it, supply a block so you can do something with it.