Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def serverQuery(request, url):
data = request.SerializeToString()
urll = urlparse.urlparse(args.url)
req = urllib2.Request(args.url, data, {"Content-type": "application/octet-stream" })
res = urllib2.urlopen(req)
data = res.read()
response = Response()
response.ParseFromString(data)
if len(response.exception) != 0:
raise Exception(response.exception)
return response
def serverQuery(request, url):
data = request.SerializeToString()
urll = urlparse.urlparse(args.url)
req = urllib2.Request(args.url, data, {"Content-type": "application/octet-stream" })
res = urllib2.urlopen(req)
data = res.read()
response = Response()
response.ParseFromString(data)
if len(response.exception) != 0:
raise Exception(response.exception)
return response