title: AJAX Posting to Python cgi
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/10718572/post-json-to-python-cgi">Post JSON to Python CGI</a>  </p>
  </blockquote>
  
  
  
  <p>I have got Apache2 Installed and Python working.</p>
  
  <p>I am having a problem though. I have two pages.</p>
  
  <p>One a Python Page and the other an Html Page with JQuery
  I couldent pase the Src to the google jquery link.</p>
  
  <p>Can someone please tell me how I can get my ajax post to work correctly.</p>
  
  <pre><code>    $(function()
      {
          alert('Im going to start processing');
  
          $.ajax({
              url: "saveList.py",
              type: "post",
              data: {'param':{"hello":"world"}},
              dataType: "application/json",
              success : function(response)
              {
                  alert(response);
              }
          });
      });
  </code></pre>
  
  <p>And the Python Code</p>
  
  <pre><code>import sys
  import json
  
  def index(req):
      result = {'success':'true','message':'The Command Completed Successfully'};
  
      data = sys.stdin.read();
  
      myjson = json.loads(data);
  
      return str(myjson);
  </code></pre>