我正在尝试来自betfair api的以下示例代码:
import requests
import json
url="https://api.betfair.com/betting/json-rpc"
header = { 'X-Application' : appKey, 'X-Authentication' : sessionToken, 'content-type' : 'application/json' }
jsonrpc_req='{"jsonrpc": "2.0", "method": "SportsAPING/v1.0/listCompetitions", "params": {"filter":{ "eventTypeIds" : [1] }}, "id": 1}'
print json.dumps(json.loads(jsonrpc_req), indent=3)
print " "
response = requests.post(url, data=jsonrpc_req, headers=header)
print json.dumps(json.loads(response.text), indent=3)
我不断得到ValueError: No JSON object could be decoded
。