Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/webpack/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android HttpPost:将映像发送到web服务器并接收请求_Android - Fatal编程技术网

Android HttpPost:将映像发送到web服务器并接收请求

Android HttpPost:将映像发送到web服务器并接收请求,android,Android,我是android新手,所以请容忍我使用的错误术语。我正在编写一个应用程序,帮助识别图像的位置。 已将捕获的图像发送到web服务器。 但是没有从服务器收到答案 收听并从web服务器接收有关捕获图像位置的信息,并向用户显示 hier是发出请求的代码: try { response = httpClient.execute(postRequest); entityReceived = response.getEntity();

我是android新手,所以请容忍我使用的错误术语。我正在编写一个应用程序,帮助识别图像的位置。 已将捕获的图像发送到web服务器。 但是没有从服务器收到答案

收听并从web服务器接收有关捕获图像位置的信息,并向用户显示

hier是发出请求的代码:

try {
                response = httpClient.execute(postRequest);
                entityReceived = response.getEntity();
                try {
                    String result = EntityUtils.toString(entityReceived, "UTF-8");
                    System.out.println("Response: " + result);
                } catch (ClientProtocolException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                } catch (ParseException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            } catch (ClientProtocolException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
          } 

您可以使用以下代码检查状态代码

HttpResponse response = httpclient.execute(httpRequest);
int status = response.getStatusLine().getStatusCode();

而且

我认为你文章中的问题在于,你没有将有效的内容发布到url想要的url。在浏览器中使用该url检查您的帖子,会出现什么结果。

返回任何值,因为它总是在HttpResponse response=httpclient.execute(httpRequest)上崩溃;我找不到你。。请解释一下。