title: How to send data from JavaScript to Python
body: <p>I am using GAE for web development, on jinja2 and python2.7</p>
  
  <p>I can get data from Python. But I failed to send data from JavaScript to Python. Here is the JavaScript code:</p>
  
  <pre><code>function toSave() {
      var val_no = $('#field-no').val();
      var val_name = $('#field-name').val();
      var val_address = $('#field-address').val();
      var val_phone = $('#field-phone').val();
      var val_car = $('#field-car').val();
      var val_penalty = $('#field-penalty').val();
  
      $.ajax({
          type: 'GET',
          url: "https:/test/User_update",
          data: {
              "no": val_no,
              "name": val_name,
              "address": val_address,
              "phone": val_phone,
              "car": val_car,
              "penalty": val_penalty
          },
          dataType: "json"
      }).done(function () {
          $('#modal-1').modal('hide');
          table.row.data([val_no, val_name, val_address, val_phone, val_car, val_penalty, UserIndex_CreateEditButton(val_no, val_name, val_address, val_phone, val_car, val_penalty), UserIndex_CreateDeleteButton(val_no)], $('#' + tempUpdate));
      });
  }
  </code></pre>
  
  <p>And the Python code (class User_update in main.py):</p>
  
  <pre><code>import os
  import webapp2
  import MySQLdb
  import json
  import logging
  import googlemaps
  import jinja2
  import sys
  import urllib
  import urllib2
  import json as simplejson
  import codecs
  
  reload(sys)
  sys.setdefaultencoding('utf-8')
  from operator import eq
  from datetime import datetime
  from collections import OrderedDict
  
  class User_update(webapp2.RequestHandler):
  def get(self):
  
      jsonData = json.loads(self.get('data'))
  
  #   penalty = self.request.get('data')
  
  #   phone = urllib.request.urlopen(req).read() 
  #   data = urllib.requset.urlopen("http://www.daum.net").read()
  #   phone=urllib2.urlopen("https://firststep-2016.appspot.com/Log").read()  
  
      self.response.headers['Content-Type']='text/plain'
  
      db = connect_to_cloudsql()
      cursor = db.cursor()
      cursor.execute("SET names utf8")
      cursor.execute('SET SQL_SAFE_UPDATES=0;')
      cursor.execute("""update User set name='%s',address='%s',phone='%s',car_num='%s',penalty='%s' where no='%s' """%(jsonData.name,jsonData.address,jsonData.phone,jsonData.car,jsonData.penalty,jsonData.no))
      db.commit()
      db.close()
  </code></pre>
  
  <p>How can I get the JavaScript data from Python?</p>