I\'m building an \"API API\", it\'s basically a wrapper for a in house REST web service that the web app will be making a lot of requests to. Some of the web service calls need
import urllib
data = {}
data["val1"] = "VALUE1"
data["val2"] = "VALUE2"
data["val3"] = "VALUE3"
url_values = urllib.urlencode(data)
url = "https://www.python.org"
print url + "?" + url_values
The url_values
is an encoded values and can be used to post to the server along with url as a query string(url+"?"+url_values)
.