我的Android应用程序不会从我的网站收回json数据,但从其他网站检索相同的数据 [英] My android app does not retieve json data from my web site but retrieve the same data from other sites

查看:71
本文介绍了我的Android应用程序不会从我的网站收回json数据,但从其他网站检索相同的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试将帖子数据创建到我的网站并检索结果我首先通过从http://services.hanselandpetal.com/feeds/flowers.json检索json数据来尝试我的android代码,这是工作罚款



但我尝试使用相同的Android应用程序从我的网站检索相同数据的问题。和我试图检索这些数据的问题相同



/ *输出标题* /



$ data = array(result=> 0,message=>错误!);

标题('Content-type:application / json');

echo json_encode($ data);

?>请帮助我,非常感谢每一个人。



我尝试过:



我从其他网站检索了相同的数据并且工作正常

但是我的网站没有工作

I am try to create app the post data to my web site and retrieve the result first I try my android code by retrieve json data from http://services.hanselandpetal.com/feeds/flowers.json and it is work fine

but the problem that I tried to retrieve the same data from my web site using the same android app. and the same problem that I try to retrieve these data

/* Output header */

$data = array("result" => 0, "message" => "Error!");
header('Content-type: application/json');
echo json_encode($data);
?> please Help me and thanks so much for every one.

What I have tried:

I have retrieved the same data from other site and it is work fine
but my site did not work

推荐答案

data = array(result=> 0,message=>错误!);

标题('Content-type:application / json');

echo json_encode(
data = array("result" => 0, "message" => "Error!");
header('Content-type: application/json');
echo json_encode(


data);

?>请帮助我,非常感谢每一个人。



我尝试过:



我从其他网站检索了相同的数据并且工作正常

但是我的网站无法正常工作
data);
?> please Help me and thanks so much for every one.

What I have tried:

I have retrieved the same data from other site and it is work fine
but my site did not work


这篇关于我的Android应用程序不会从我的网站收回json数据,但从其他网站检索相同的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆