URLExecute in v10.1 Username&密码无法使用CloudDeploy API

时间:2018-05-05 22:51:33

标签: wolfram-mathematica

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

我使用CloudConnect功能登录笔记本电脑。然而即使在那之后我仍然得到相同的回应。

如果我提供相同的登录凭据,我使用登录Wolfram Cloud作为URLExecute的参数作为“用户名”和“密码”选项,那么它仍然失败并告诉我需要登录云。 (我把...代替他们在这里)

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

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"

1 个答案:

答案 0 :(得分:0)

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