Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 3.x 使用python连接RESTAPI:TypeError:';dict';对象不可调用_Python 3.x_Api_Request - Fatal编程技术网

Python 3.x 使用python连接RESTAPI:TypeError:';dict';对象不可调用

Python 3.x 使用python连接RESTAPI:TypeError:';dict';对象不可调用,python-3.x,api,request,Python 3.x,Api,Request,我正在尝试连接到iso4app api以下载等时线 进口请求 进口大熊猫 导入json def jprint(obj): # create a formatted string of the Python JSON object text = json.dumps(obj, sort_keys=True, indent=4) print(text) parametros = {"type" : "isodistance", "value" :

我正在尝试连接到iso4app api以下载等时线

进口请求 进口大熊猫 导入json

def jprint(obj):
    # create a formatted string of the Python JSON object
    text = json.dumps(obj, sort_keys=True, indent=4)
    print(text)

parametros = {"type" : "isodistance",
              "value" : 10000,
              "lat" : 43.334098,
              "lng" : -1.7920697,
              "approx" : 1000,
              "mobility" : "motor_vehicle",
              "speedType" : "normal",
              "reduceQueue" : "false",
              "avoidTolls" : "true",
              "restrictedAreas" : "false",
              "fastestRouting" : "true",
              "concavity" : 6,
              "buffering" : 3,
              "reqId" : "A57X"}

respuesta = request.GET("http://www.iso4app.net/rest/1.3/isoline.geojson?licKey=4ECDEFB8-1F48-4A0B-A5CA-5B0420162922", parametros)
但是我不能让它工作。我试着操纵dict,删除了任何可能的变量dict,使用了与iso4app示例完全相同的参数……都没有用。我似乎是一个愚蠢的问题,但我无法解决它。
请和谢谢你

谢谢。我真不敢相信我竟然忘了只有一个S。我应该删除我贴的这样一个愚蠢的问题吗?你的问题提高了我的声誉
def jprint(obj):
    # create a formatted string of the Python JSON object
    text = json.dumps(obj, sort_keys=True, indent=4)
    print(text)

parametros = {"type" : "isodistance",
              "value" : 10000,
              "lat" : 43.334098,
              "lng" : -1.7920697,
              "approx" : 1000,
              "mobility" : "motor_vehicle",
              "speedType" : "normal",
              "reduceQueue" : "false",
              "avoidTolls" : "true",
              "restrictedAreas" : "false",
              "fastestRouting" : "true",
              "concavity" : 6,
              "buffering" : 3,
              "reqId" : "A57X"}

respuesta = requests.get("http://www.iso4app.net/rest/1.3/isoline.geojson?licKey=4ECDEFB8-1F48-4A0B-A5CA-5B0420162922", parametros)