esri 和 Python 之间的连接错误

Connection error between esri and Python

我正在尝试 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"
 }
}