Answers for "how to make http get request with python requests"

17

get requests from python

import requests

response = requests.get('<api-endpoint>')
response.raise_for_status()

data = response.json()
print(data)
Posted by: Guest on March-24-2021
0

how to get requests response code with python

import urllib.request
import time
def result_from_site(url_of_site):
    weburl = urllib.request.urlopen(url_of_site)
    return str(weburl.getcode())
print(result_from_site("https://www.linkedin.com/learning/learning-python/fetching-internet-data"))
Posted by: Guest on October-06-2021

Code answers related to "how to make http get request with python requests"

Python Answers by Framework

Browse Popular Code Answers by Language