use urlencode instead of json.dumps