http - URL request from Python -


i have server running , listening value field
can make requests web browser url,

eg: http://192.168.1.101/value=1 

how can make request python, tried above code doesnt seem work.

from urllib.parse import urlencode urllib.request import request, urlopen url = 'http://192.168.1.101/value=1' request = request(url) 

my server listening in above formate.(get)

get /value=1 http/1.1 

cheers!

use requests module

import requests req url = 'http://192.168.1.101/value=1' resp = req.get(url) print(resp.text) # printing response 

Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -