requests module

#requests module allows user to send http requests using python
import requests
#this method is used to get data from the url
#re=requests.get("https://nharishcoding.blogspot.com/2021/09/os-module")
re1=requests.get("https://financialmodelingprep.com/api/company/price/AAPL")
print(re1.text)
print(re1.status_code)

#this function is used to post data to the server to the given url
dic1={"key1":"value1","key2":"value2"}
url="https://nharishcoding.blogspot.com/"
re2=requests.post(url=url,data=dic1)
print(re2.status_code)

Comments

Popular posts from this blog

Tokens in C

Steps taken by a compiler to execute a C program

Variables and Data Types in C