gpt4 book ai didi

javascript - esri和Python之间的连接错误

转载 作者:行者123 更新时间:2023-12-03 11:03:23 24 4
gpt4 key购买 nike

我正在尝试将 Python 文件转换为 Javascript,并且正在使用 Esri 库。我编写了以下代码,但它一直给我错误。

var myObj //defined as a string which is passed to 
require(["esri/request"], function(esriRequest){
var dd=esriRequest{
content: {myObj},
handleAs: "json",
url: "www.example.com/pythonFile.py"
}
}

如果有任何帮助,我将不胜感激

最佳答案

我认为,如果 example.com 需要身份验证,您可能会错过在 esriRequest 变量的内容中传递 token 。在这种情况下,正确答案是:

token = "" //a string which gives you the permission to visit example.com you can take it after giving credentials to the mapserver or website
var myObj //defined as a string which is passed to
require(["esri/request"], function(esriRequest){
var dd=esriRequest{
content: {"SP": myObj, token: token},
handleAs: "json",
url: "www.example.com/pythonFile.py"
}
}

关于javascript - esri和Python之间的连接错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27974464/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com