I am developing an application that connects to a web service, providing a json string with data and receiving a reply. I use the following code, where I build the json and try to post it:
def connectToService(request):
data='foxp3 factor'
l=[]
l.append(data)
l.append(80)
l.append(5)
data=json.dumps({"findCitations":l})
result = urllib2.urlopen('http://www.example.com/webservice', urllib.urlencode(data))
But it doesn't work. I hope that the json reply from the web service will be stored in result and then I will figure out a way to parse it, probably by deseriazizing it. Although there is much literature about it (json, simplejson, HttpPequest) and it has to be pretty simple I have not manage to do it yet. Any solutions?