Sending Https Request But Not Getting Response

Viewed 250

I am sending Https request to mysql server but not getting the response while performing the same task on localhost it is working. I have no experience using Https, please give me solution and explain difference between Http and Https request sending to mysql server, hope someone help me thanks in advance.

This is my code

protected String doInBackground(String... params) {
                String emailSend = params[0];
                String tokenSend = params[1];
                String deviceIdSend = params[2];
                List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
                nameValuePairs.add(new BasicNameValuePair("email", emailSend));
                nameValuePairs.add(new BasicNameValuePair("token", tokenSend));
                nameValuePairs.add(new BasicNameValuePair("deviceId", deviceIdSend));
                try {
                    HttpClient httpClient = new DefaultHttpClient();
                    HttpPost httpPost = new HttpPost("https://xyz/xyz/xyz.php");
                    httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
                    HttpResponse response = httpClient.execute(httpPost);
                    HttpEntity entity = response.getEntity();

                    is = entity.getContent();
                    BufferedReader reader = new BufferedReader(new InputStreamReader(is, "UTF-8"), 8);
                    StringBuilder sb = new StringBuilder();
                    String line = null;
                    while ((line = reader.readLine()) != null) {
                        sb.append(line);
                    }
                    result = sb.toString();
                } catch (ClientProtocolException e) {

                } catch (IOException e) {

                }
                return "success";
            }
            @Override
            protected void onPostExecute(String resultN) {
                super.onPostExecute(resultN);
                String s = resultN.trim();
                //dialog.dismiss();
                if (s.equalsIgnoreCase("success")) {
                    if (result.contains("Pass")) {
0 Answers
Related