I have a bottle web server and am using jQuery to do my ajax requests using json, but either one is not sending or the other is not receiving, I'm not sure which. My code is basically this:
server.py
@route("/jsontest", method="POST")
def jsontest():
print(request.json)
Always prints None, the request is going through of course, but it doesn't appear to be receiving any data.
javascript
$.post("/jsontest", {username: $loginName}, login_success)
The javascript is trigger upon a button press and loginName is taken from an input box. In the js I've done a console.log($loginName) to ensure it's actually selecting it properly and it is, so I'm assuming the problem is in that one jQuery call or I'm not reading the data properly on the server end. Both seem pretty simple an straightforward though so I'm not sure what I may be missing.