I need to call a WCF Rest Service passing JSON. The problem I can't figure out is I don't have name value pairs. I need to pass something like this (this is in SoapUI):
["SB2011-037","SB2013-028"]
I have been trying to use URLEncode and I am guessing that is not the way to go. I have also seen some stuff with urllib.quote but that doesn't seem right.
url = "http://server/testService/Services/Posse.svc/rest/GetDataByProjectNumbers"
values = urllib.urlencode({
'': 'SB2013-028',
'': 'SB2011-037',
})
#data = urllib.urlencode(values)
request = urllib2.Request(url,data)
result = urllib2.urlopen(request)
Have tried a couple of things I have seen.
values = {["SB2011-037","SB2013-028"]}
values = urllib.urlencode({
None: 'SB2013-028',
None: 'SB2011-037',
})
values = urllib.urlencode({
'': 'SB2013-028',
'': 'SB2011-037',
})
Thanks very much.