Http请求问题

时间:2015-06-03 18:12:16

标签: android web-services http

当我在android中使用http发出请求时,我无法从服务器获得响应。我正在调用一个正在浏览器上工作的网址,但是默认的http客户端请求给了我响应代码500,响应如下。缺少什么?

<body>
    <h1>Cannot read property &#x27;_id&#x27; of undefined </h1>
    <p>[object Object]</p>
    </body>

这是代码

HttpClient httpclient = new DefaultHttpClient();
        Log.v("", "url is: "+url);

        HttpGet httppost = new HttpGet("http://54.255.228.162:3000/item?action=redeem&event=55018105f0df610b1c3919a2");

        try {


            org.apache.http.HttpResponse response = httpclient.execute(httppost);
            int responsecode = response.getStatusLine().getStatusCode();
result = EntityUtils.toString(response.getEntity());
} catch (Exception ex) {
            ex.printStackTrace();
        }

0 个答案:

没有答案