请求抛出错误引发JSONDecodeError("期望值",s,err.value)从None

时间:2017-05-27 08:03:29

标签: python 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=headers)

print(json.dumps(json.loads(response.text), indent=3))

它抛出了这个:raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

我假设这意味着jsonrpc_req

有问题

然而json.dumps的输出看起来还不错:

{
   "jsonrpc": "2.0",
   "method": "SportsAPING/v1.0/listCompetitions",
   "params": {
      "filter": {
         "eventTypeIds": [
            1
         ]
      }
   },
   "id": 1
}

服务器响应也是410.

我不明白如何获得无

0 个答案:

没有答案