python json请求有些缺失吗?

时间:2014-04-23 21:10:26

标签: python json python-requests

我只测试请求。 我通过pip安装请求安装它 和我的用户r=requests.get("http://localhost/json") 这是简单的数据 {" info":"是"}这个json文件 我用 信息= r.json ["信息"] 它显示错误

Traceback (most recent call last):
  File "/mysns/bbsns/test.py", line 12, in <module>
    info=r.json()["info"]
  File "/usr/local/lib/python3.4/site-packages/requests/models.py", line 741, in json
    return json.loads(self.text, **kwargs)
  File "/usr/local/lib/python3.4/json/__init__.py", line 318, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.4/json/decoder.py", line 343, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.4/json/decoder.py", line 361, in raw_decode
    raise ValueError(errmsg("Expecting value", s, err.value)) from None
ValueError: Expecting value: line 2 column 1 (char 1)
有人可以告诉我,问题出在哪里? 看起来像json不能在我的系统中使用

0 个答案:

没有答案