I discovered the reply to my (dumb) problem and listed it below.
I am using Python 2.7.1+ on Ubuntu 11.04. The customerOrhost are on a single computer.
In the Wing debugger, I understand the server code has been known as and that i can walk-through the code one line at any given time. In cases like this, I understand 22 bytes were moved.
In Firebug, I saw this data underneath the Internet Publish tab:
Parameter application/x-www-form-urlencoded fname first lname last Source Content-Type: application/x-www-form-urlencoded Content-Length: 22 fname=first&lname=last
This is actually the client code that I am using:
<html> <form action="addGraphNotes.wsgi" method="post"> First name: <input type="text" name="fname" /><br /> Last name: <input type="text" name="lname" /><br /> <input type="submit" value="Submit" /> </form> </html>
Which is the server code:
import urlparse def application(environ, start_response): output =  # the environment variable CONTENT_LENGTH may be empty or missing try: # NOTE: THIS WORKS. I get a value > 0 and the size appears correct (22 bytes in this case) request_body_size = int(environ.get('CONTENT_LENGTH', 0)) except (ValueError): request_body_size = 0 try: # environ['QUERY_STRING'] returns "" **values = urlparse.parse_qs( environ['QUERY_STRING'] )** except: output = ["parse error"]
Within the Wing debugger, I have verified that information is being passed in the client towards the server:
>>> environ['wsgi.input'].read() 'fname=first&lname=last'
FOUND MY PROBLEM. I Replicated AND Copied and pasted Within The WRONG CODE. This Is Actually The CODE I Had Been USING FOR FORMS BUT STOP ADDING IT After I Began USING AJAX AND STOPPED USING FORMS. Now, things are working fine.
# When the method is POST the query string will be sent # in the HTTP request body which is passed by the WSGI server # in the file like wsgi.input environment variable. request_body = environ['wsgi.input'].read(request_body_size) values = parse_qs(request_body)
You are carrying out a
POST query therefore the
QUERY_STRING is definitely likely to be empty because it signifies the query string of the
GET request (additionally, it may come in other request types but it is unrelated towards the problem at hands). You are meant to parse
POST data by consuming the