2016-01-15 69 views
0

我已经在Android 开始教程使用Parse我设置清单和内部App.onCreate初始化解析API教程测试返回404

Parse.enableLocalDatastore(this); 
Parse.initialize(this); 
ParseFacebookUtils.initialize(this, C.REQUEST_CODE_FB_LOGIN); 

ParseObject testObject = new ParseObject("TestObject"); 
testObject.put("foo", "bar"); 
testObject.saveInBackground(); 

的问题是,我可以在我的代理看该数据正在发送但响应是:

HTTP/1.1 404 Not Found 
Content-Type: text/html; charset=utf-8 
Date: Fri, 15 Jan 2016 17:08:43 GMT 
Server: nginx/1.6.0 
Content-Length: 168 
Connection: keep-alive 

<html> 
<head><title>404 Not Found</title></head> 
<body bgcolor="white"> 
<center><h1>404 Not Found</h1></center> 
<hr><center>nginx/1.6.0</center> 
</body> 
</html> 

任何想法为什么他们的基本教程失败?

回答

0

您是否在Parse中登录并检查服务器中是否存在该对象。 这里你的“TestObject”是间接你的DataTable。

基本上你必须在Parse帐户中创建对象表,然后运行这段代码。

要捕捉解析错误使用下面的代码

试试这个,看看什么ü获取变量“e”的

testObject.saveInBackground(new SaveCallback() { 
     @Override 
     public void done(ParseException e) { 
     if (e != null) { 
      //Error 
       } else { 
      //No error 
     } 
} 
+0

是,响应其不被保存 – AndroidGecko

+0

@AndroidGecko转到您的解析帐户的Web控制台。在那里创建一个对象/表,然后执行这个............表名:TestObject有一列,Coulmn名称:foo –

+0

谢谢,它不应该因为我有“允许客户类创建”设置为true – AndroidGecko