d.devendran 0 Newbie Poster

hi expert, i got data when execute the python, then i have send it to the server, how this can be done,

i.e I got wireless ssid, so i need to send as follow

http://22.42.13.58:8080/ProcessData?ssid="guest"

how this can be done

i found snippet as follow

import urllib
import urllib2
#PROXY = urllib2.ProxyHandler({'https': 'http://22.42.13.58:8080/'})
#OPENER = urllib2.build_opener(PROXY)
#urllib2.install_opener(OPENER)
URL = 'https://22.42.13.58:8080/ProcessData'
POST = {'ssid' : 'guest'}
DATA = urllib.urlencode(POST)
HTTPS = urllib2.Request(URL,DATA)
RESP = urllib2.urlopen(HTTPS)
OUTPUT = RESP.read()
print OUTPUT

but getting error as follow

File "test3.py", line 14, in <module>
RESP = urllib2.urlopen(HTTPS)
File "/usr/lib/python2.6/urllib2.py", line 124, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.6/urllib2.py", line 389, in open
response = self._open(req, data)
File "/usr/lib/python2.6/urllib2.py", line 407, in _open
'_open', req)
File "/usr/lib/python2.6/urllib2.py", line 367, in _call_chain
result = func(*args)
File "/usr/lib/python2.6/urllib2.py", line 1154, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "/usr/lib/python2.6/urllib2.py", line 1121, in do_open
raise URLError(err)

can anyone help me

thanks in advance

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.