Beginning to climb the ajax learning curve, I'm trying to make a simple ajax call back to my CherryPy application and echo the data sent back to the browser.
My ajax call is working and I can return, for instance, the request method back to the browser.
I cannot, however, find the data sent by browser in the request object inside my CherryPy handler. Here is my CherryPy handler, cribbed from this question:
class Contact:
def index(self):
    cl = cherrypy.request.headers['Content-Length']
    rawbody = cherrypy.request.body.read(int(cl))
    body = None
    #body = simplejson.loads(rawbody)
    if body is None:
        return cherrypy.request.method + ' (no body found)'
    else:
        return cherrypy.request.method + ' ' + body
index.exposed = True
and here's my Javascript:
<script type="text/javascript">
function SendContactEntry() {
$.ajax( {type:        "POST",
     url:         "/contact/",
     data:        { word: "HELLO" },
     processData: false,
     cache:       false,
     contentType: "application/json",
     dataType:    "text",
     success:     function (response){
                alert(response);
              }
    }
);
}
</script>    
Using this code my browser receives back a response of "POST (no body found)".
What I want to do is learn, in my CherryPy handler, that I was sent a word value of "HELLO".
If I uncomment the line body = simplejson.loads(rawbody) I receive an HTML Status of 500 back from CherryPy.  The same happens if I try to decorate my index() function with @cherrypy.tools.json_in().
 
     
     
    