v10.1 中的 URLExecute 用户名和密码不适用于 CloudDeploy API

URLExecute in v10.1 Username & Password not working with CloudDeploy API

我使用的是 Mathematica 10.1.0,我创建了一个简单的 API 并将其部署到 CloudAPI。然后当我尝试通过 URLExecute 使用它时,我总是得到一个响应,我需要登录到云。

我已经使用CloudConnect 功能登录笔记本。然而即使在那之后,我仍然得到同样的回应。

如果我提供与登录 Wolfram Cloud 相同的登录凭据作为 URLExecute 的参数作为 "Username" 和 "Password" 选项,那么它仍然失败并告诉我我需要登录云端。 (我在这里用 ... 代替了它们)

下面是我的笔记本代码和明确传递用户名和密码的响应。任何帮助或解释将不胜感激。


In[1]:= CloudConnect[]

Out[1]= "..."

In[3]:= func = APIFunction[{"x" -> "Integer"}, FactorInteger[#x] &];

In[4]:= APIFunction[{"x" -> "Integer"}, FactorInteger[#x] &]

Out[4]= APIFunction[{"x" -> "Integer"}, FactorInteger[#x] &]

In[5]:= api = CloudDeploy[func]

Out[5]= CloudObject["https://www.wolframcloud.com/objects/ab5a5cc1-\
e101-4200-8858-ca45072b1085"]

In[6]:= URLExecute["https://www.wolframcloud.com/objects/ab5a5cc1-\
e101-4200-8858-ca45072b1085", 
 {"x" -> "10"}, 
 "Username" -> "...",
 "Password" -> "..."
 ]


Out[6]= "Sign In with Your Wolfram ID  

  Email      
  Password      
    Remember me      
  Sign in    
Forgot your password?         Don't have a Wolfram ID? Create one .   \
           © 2018 Wolfram Research, Inc. | Terms | Privacy | Support"

重启 Mathematica 后,这个问题在本地消失了。仍然不确定为什么它会感到困惑,因为我已经注销并通过设置重新登录到 Mathematica 本身,所以我知道它正在登录我,因为我测试了其他必须使用令牌下载数据的调用。无论如何,如果你看到这个,请重新启动...