January 2019
Beginner
318 pages
8h 23m
English
We are going to see two http requests: GET and POST. We are also going to make an http connection.
First, we are going explore an example of making an http connection. For that, create a make_connection.py script and write the following content in it:
import http.clientcon_obj = http.client.HTTPConnection('Enter_URL_name', 80, timeout=20)print(con_obj)
Run the script and you will get the output as follows:
student@ubuntu:~/work$ python3 make_connection.py<http.client.HTTPConnection object at 0x7f2c365dd898>
In the preceding example, we made a connection with the URL mentioned on port 80 for a specific timeout.
Now we will see the http GET request method; using this GET request method, we will see an example where we ...
Read now
Unlock full access