Closed. This question is off-topic。它当前不接受答案。
                            
                        
                    
                
                            
                                
                
                        
                            
                        
                    
                        
                            想改善这个问题吗? Update the question,所以它是on-topic,用于堆栈溢出。
                        
                        5年前关闭。
                                                                                            
                
        
从startSSL.com向我的服务器添加证书之前,该应用程序运行良好。
POST阵列在服务器上为空。而且我没有任何错误,我从服务器得到响应。

这是我用于在AsyncTasks中进行服务器调用的代码。

    // Making HTTP request
    try {

        // check for request method
        if(method == "POST"){
            // request method is POST

            // defaultHttpClient
            DefaultHttpClient httpClient = new DefaultHttpClient();
            HttpPost httpPost = new HttpPost(url);
            httpPost.setEntity(new UrlEncodedFormEntity(params));

            HttpResponse httpResponse = httpClient.execute(httpPost);
            HttpEntity httpEntity = httpResponse.getEntity();
            is = httpEntity.getContent();

        }else if(method == "GET"){
            // request method is GET
            DefaultHttpClient httpClient = new DefaultHttpClient();
            //String paramString = URLEncodedUtils.format(params, "utf-8");
           // url += "?" + paramString;

            for (NameValuePair nameValuePair : params) { // modificado para usar URIS
                url += "/" + nameValuePair.getValue();
            }
            Log.d("Intentando conectar con el servidor: ", url);
            HttpGet httpGet = new HttpGet(url);
            HttpResponse httpResponse = httpClient.execute(httpGet);
            HttpEntity httpEntity = httpResponse.getEntity();
            is = httpEntity.getContent();
        }


任何想法?

最佳答案

这是服务器问题。从网址中删除“ www”部分即可解决。我没有使用www配置我的服务器,但是我没有想到它会以这种方式让我汗水。

关于android - 我没有收到Android应用发送的POST变量(与SSL相关的https),我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/24985835/

10-10 22:49