You are on page 1of 5

Computer Networking Lab

Course code : CSE 312

Submitted by: Submitted to:


Sikder Md Mahbub Alam Mohammad Ehsan Shahmi
Chowdhury
Id : 183002005
Section : DC Lecturer
Dept : CSE CSE, GUB
1) Introduction of HTTP GET and POST Method
The HTTP GET method is sent to get data from a server. Its a url method

The HTTP POST method is sent to send data to the server. Submitting a completed web form.

2) Objectives
To analyze the HTTP get and post methods with python. Python is a general purpose language
which has simple syntax and most important less boilerplate code. With the requests module we
can send get and post requests to the server.

3) Problem Statement
1. Send a get request to google.com with user agent in the the header of the request. Then
check the response status and text
2. Send a post request with some data to jsonplaceholder.com and check the response
status and text.
4) Solution of HTTP GET Method & Solution of
HTTP POST Method
Out put :

The explanation is relatively simple (than java). Requests module has get and post method to
send get and post request. Both take a url and other optional parameter in the function call. We
can pass request headers as python dictionary in headers parameter. The post function also
has a data parameter to pass form data in the post request. It has to python thon dictionary.
Wala! Everything is done under the hood and we can check the response text and status code
with text and status_code attribute respectively.

7) Conclusion
We were able to send get and post request via requests module in python.

8) References
Python.org
Code is live here:
https://repl.it/join/czyrnfzw-mahbub97

You might also like