send get request python

import requests
requests.get("https://www.google.com/")

3.5
8
Cathy07 115 points

                                    >>> import requests
>>> r = requests.post('http://httpbin.org/post', json={"key": "value"})
>>> r.status_code
200
>>> r.json()
{'args': {},
 'data': '{"key": "value"}',
 'files': {},
 'form': {},
 'headers': {'Accept': '*/*',
             'Accept-Encoding': 'gzip, deflate',
             'Connection': 'close',
             'Content-Length': '16',
             'Content-Type': 'application/json',
             'Host': 'httpbin.org',
             'User-Agent': 'python-requests/2.4.3 CPython/3.4.0',
             'X-Request-Id': 'xx-xx-xx'},
 'json': {'key': 'value'},
 'origin': 'x.x.x.x',
 'url': 'http://httpbin.org/post'}

3.5 (8 Votes)
0
3.5
2

                                    # pip install requests
import requests
req = requests.get('<url here>', 'html.parser')
print(req.text)

3.5 (2 Votes)
0
4
6
BryKKan 95 points

                                    import socket

target_host = "www.google.com" 
target_port = 80

# create a socket object 
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)  
 
# connect the client 
client.connect((target_host,target_port))  

# receive some data 
response = client.recv(4096)
print(f'Source Code: {response}')
http_response = repr(response)

4 (6 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
how to send http request in python how to send a http request python python api json POST how to send a request in python call api in python post with json data sending a request with python GET request Python send request pytohn how to send a json object in get request python request send response python python post request body json post request in python with json body send post request python json make a post request in python with json body request post python json how to send a get request on pythonapp how to post data in json body using python requests how to send requests using python python requests post json python requests json post python request json post how to use requests get python how to send requests in python send json in requests.post python send get requests.get python3 how to send requests with request in python python send request python request post json python requestes post json body python post request json response send json in post requests python python requests post body json python requests post response as json requests json post send get request python python web request send request python python post request with json send http request with python post request python json python send post request get http response python how to get post data from a website python get request in python how to send data to server python requests how to do a request in py python send https request requests get send request to api python how to do requests python how to call post api in python python request python request.post python http request post json example python get from post request python post data to webservice post data using an api in python python requests get reponse http web request in python python rest api call with post do request python python http get request simple python python rest api post example http get request webpage python how to send an http request in python get post pytthon fetch json post request.get(url) python Requests python example python requests.GET python requests get key python get request url requests get python python http get request get call python Python send http python script to get request requests.get python get post request using requests to send requests to an API python get post response send a get request python how to send requests python send api request python python script for http request python requests headers for json string do a get request in python requests post python python post with json python get request to an url how to send get requests in python request.get python requests.post json http get request python how to make requests in python HTTP get with python python make get request get method requests python using python to make http requests requests.get with parameter in python api request and response example python requests python post json python http request do get request python python post example make a GET rquest in python post json data requests python requests.get in python python request get python send get request python post request json python get requests requests python send http request python post get request python python post json body get request in python json python request get url python post request fetch api requests in python http post request python hit a url and get value using python python get request requests post json GET requests in python rest api post python python making request send json post with pytohn requests.get python python make json request python http request example python post return json python send api request how to make a get request python python get request json call get method python post python python make http post request send data with request.get() python python make post request python send http request make get request python python call POST api get requests python send http requests python python requests get python make http request how to do get request python
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source