title: $.ajax function : send json data : parse at serverside function
body: <p>I am using $.ajax function to send json data to serverside function.</p>
  
  <pre><code>var jsonObjects = [{id:1, name:"amit"}, {id:2, name:"ankit"},{id:3,name:"atin"},{id:1, name:"puneet"}];
  
  $.ajax({
       url: "{{=URL('myControllerName')}}",
       type: "POST",
       context: document.body,
       data: {students: JSON.stringify(jsonObjects) },
       dataType: "json",
       success: function(){
           alert('ok');
    }
  
  });
  </code></pre>
  
  <p>In the serverside function, how do I access the data?</p>
  
  <p>Somebody has give the code for grails as :---</p>
  
  <pre><code>//this code is written in grails
  import grails.converters.JSON;
  List&lt;JSON&gt; students = JSON.parse(params.students) //students in request params is parsed to json objects and stored in the List
  println "Student id: " + students[0].studentId    //first element of the students list is accessed as a map holding a key studentId
  </code></pre>
  
  <p>I want to do this in a python web framework viz. web2py.</p>
  
  <p>Tried to access it as params.students and request.students, but no luck.</p>
  
  <p>What is the correct syntax to access the data sent? (I checked the jQuery API, but couldn't find the same).</p>
  
  <p>Thanks,</p>
  
  <p>Vineet </p>