title: passing JSON from ASIHTTPRequest to django
body: <p>I've exhausted other threads, so I'm posting this question here.  Please pardon any newbie mistakes I've made along the way.  I've been reading a lot, and I think I'm getting confused.  </p>
  
  <p>The Goal:
  I'm trying to pass data from a form in objective-c to my django web service.  In an effort to assist with this, I've employed the <code>ASIHTTPRequest</code> class to facilitate information transfer.  Once sent to the web service, I'd like to save that data to my sqlite3 database.  </p>
  
  <p>Procedure:
  On the Objective-C side:
  I've stored the inputted form data and their respective keys in an NSDictionary, like this:</p>
  
  <pre><code>NSDictionary *personInfo = [NSDictionary dictionaryWithObjectsAndKeys:firstName.text, @"fName", middleName.text, @"mName", lastName.text, @"lName", nil];
  </code></pre>
  
  <p>I've added it to my ASIHTTPRequest in a different class by using a delegate.  I've made the NSDictionary the same as above in the code block below for simplicity, like so:</p>
  
  <pre><code>NSString *jsonPerson = [personInfo JSONRepresentation];
  [request addRequestHeader: @"Content-Type" value:@"application/json; charset=utf-8"];
  [request appendPostData:[jsonPerson dataUsingEncoding:NSUTF8StringEncoding]];
  [request setRequestMethod:@"POST"]; 
  [request startAsynchronous]; 
  </code></pre>
  
  <p>And a NSLog shows the string I'm passing to look like this, which validates at least in <a href="http://jsonlint.com/" rel="nofollow">JSONLint</a></p>
  
  <pre><code>{"mName":"Arthur","lName":"Smith","fName":"Bob"}
  </code></pre>
  
  <p>Because I'm seeing what appears to be valid JSON coming from my ASIHTTPRequest, and actions are running from requestfinished: rather than requestfailed:, I'm making the assumption that the problem more than likely isn't on the Objective-C side, but rather on the django side.  </p>
  
  <p>Here's what I've tried so far:</p>
  
  <pre><code>json.loads(request.POST)
  &gt;&gt;expected string or buffer
  
  json.loads('request.POST')
  &gt;&gt;no JSON object to decode
  
  json.loads(request.raw_post_data)
  &gt;&gt;mNamelNamefName
  
  incoming = request.POST
  &gt;&gt;{"mName":"Arthur","lName":"Smith","fName":"Bob"}
  
  incoming = request.POST
  onlyValues = incoming.iterlists()
  &gt;&gt;(u'{"mName":"Arthur","lName":"Smith","fName":"Bob"}', [u''])
  </code></pre>
  
  <p>...and a smattering of other seemingly far-fetched variations.  I've kept a log, and can elaborate.  The only hope I've been able to find is in the last example; it looks like it's treating the entire string as the key, rather than breaking up each dict object and key as I would have expected.</p>
  
  <p>I realize this is terribly elementary and I don't normally ask, but this problem has me particularly stumped.  I do also remember reading somewhere that python won't recognize the double-quotes around each object and key, that to get it to something django likes, each should be surrounded by single-quotes.  I just don't have any idea how to get them that way.</p>
  
  <p>Thanks!</p>