我在Android广播代码中获取错误500获取通知asp.net api的数据当我在浏览器上发布链接时它在浏览器中显示数据

时间:2018-03-09 10:12:30

标签: android asp.net-web-api

client.post("http://192.168.10.7:8080/api/Notifications",params ,new AsyncHttpResponseHandler() {

            @Override
            public void onSuccess(String response) {

             System.out.println(response);
                try {
                    // Create JSON object out of the response sent by getdbrowcount
                    JSONObject obj = new JSONObject(response);
                    System.out.println(obj.get("count"));
                    // If the count value is not zero, call MyService to display notification
                    if(obj.getInt("count") != 0){
                        Toast.makeText(context, "Service Started", Toast.LENGTH_SHORT).show();
                        final Intent intnt = new Intent(context, MyService.class);
                        // Set unsynced count in intent data
                        intnt.putExtra("intntdata", "Unsynced Rows Count "+obj.getInt("count"));
                        // Call MyService
                        context.startService(intnt);
                    }else{
                        Toast.makeText(context, "Sync not needed", Toast.LENGTH_SHORT).show();
                    }
                } catch (JSONException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            }

1 个答案:

答案 0 :(得分:0)

500是内部服务器错误,这意味着网站服务器上出现了问题,但服务器无法确定具体问题。