init
This commit is contained in:
commit
75312b5ee3
17 files changed
+2503
No files matched your search
+15
@@ -0,0 +1,15 @@
|
||||
import urllib
|
||||
import urllib.request
|
||||
|
||||
|
||||
def fetch(method, url, headers, body):
|
||||
request = urllib.request.Request(
|
||||
url,
|
||||
data=body,
|
||||
method=method,
|
||||
)
|
||||
for header, value in headers:
|
||||
request.add_header(header, value)
|
||||
|
||||
response = urllib.request.urlopen(request)
|
||||
return response.read()
|
||||
Reference in new issue
Block a user