Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Passing Information Using POST Method in Python

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 318
    Comment on it

    We pass information to a CGI program in the POST method. And post packages give the information in exactly the same way as GET methods but instead of sending it as a text string after using post. In the URL it sends it as a separate message. This message comes into the CGI script in the form of the standard input and output.
    For example you can see below code.

    #!/Dinesh/bin/python
    # Import modules for CGI handling 
    import cgi, cgitb 
    
    # Create instance of FieldStorage 
    form = cgi.FieldStorage() 
    
    # Get data from fields
    first_name = form.getvalue('Test')
    last_name  = form.getvalue('Demo')
    
    print "Content-type:text/html\r\n\r\n"
    print ""
    print ""
    print "Hello - Second CGI Program"
    print ""
    print ""
    print "Hello %s %s" % (Test, Demo)
    print ""
    print ""
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: