HTTP Requests using Python

Sowmiya K
2 min readSep 12, 2021

--

HTTP is a set of protocols designed to enable communication between clients and servers. First and foremost need to install requests package using !pip install requests command in juypter notebook.

Methods :

GET - Used to retrieve information from the server by using URL

POST - Request the server to upload a file

PUT - Generally used to update existing entity

DELETE - Deletes the specified resource in the server

OPTION - Allow the client to determine the options without implying a resource action

GET

In this project to get the information about San Francisco weather using api in metaweather.com. to access these information need to import some required packages in juypter notebook. checking the version, copyrights and after get the url checking the status code when we have 200 connection is successful. In this website get case insensitive so here i used pprint.

using json package to print the content in json format and check the website is redirect or not, False printed that means there is no redirection is here.

--

--

Sowmiya K
Sowmiya K

Written by Sowmiya K

Working for HCL as a Senior Software Engineer | Interested in Networking | cybersecurity | Python

No responses yet