Modules | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Modules

Would I be able to use web api on SoloLearn in python? Obviously using one of the web modules such as urlib import urllib import json try: data = { 'name' : 'mike', 'age' : 45 } request = urllib.request.Request('https://httpbin.org/get?' + urllib.parse.urlencode(data) ) # make the request URL response = urllib.request.urlopen(request) # execute the request raw_data = response.read() # read the data object_data = json.loads(raw_data) # deserilaize the data into python object print(object_data) except urllib.error.HTTPError as e: print(e)

19th Jul 2020, 2:02 PM
Bruh
1 Answer
+ 1
Yes it will work here try it in your code section
19th Jul 2020, 3:25 PM
AKSHAY🇮🇳
AKSHAY🇮🇳 - avatar