I have written the following python script, using python requests (http://requests.readthedocs.org/en/latest/):
import requests
payload = {\'key1\': \'value 1\
To follow up on @WeaselFox's answer, they introduced a patch that accepts a quote_via
keyword argument to urllib.parse.urlencode
. Now you could do this:
import requests
import urllib
payload = {'key1': 'value 1', 'key2': 'value 2'}
headers = {'Content-Type': 'application/json;charset=UTF-8'}
params = urllib.parse.urlencode(payload, quote_via=urllib.parse.quote)
r = requests.get("http://example.com/service", params=params, headers=headers,
auth=("admin", "password"))