January 2019
Beginner to intermediate
776 pages
19h 58m
English
Let us submit some fake data to register with https://twitter.com/. Each form submission has two methods: GET and POST. The less sensitive data, for example, search queries, are usually submitted by GET and the more sensitive data is sent via the POST method. Let us try submitting data with both of them.
Listing 4.4 explains the submit web forms, as follows:
#!/usr/bin/env python # Python Network Programming Cookbook -- Chapter - 4 # This program requires Python 3.5.2 or any later version # It may run on any other version with/without modifications. # # Follow the comments inline to make it run on Python 2.7.x. import requests import urllib # Uncomment the below line for Python 2.7.x. #import urllib2 ID_USERNAME = 'signup-user-name' ...
Read now
Unlock full access