How to receive html response through volley
<p>I am calling web service through volley. In that web service i am sending three input parameters using json object. but in response i am receiving html response.
and it gives me error. how to get html response in onResponse method? is there any solution to solve this problem?    </p>

<pre><code>  private void callWebServiceToGetDetails(final String uID, final String oID, final String sToken) {
        // initialize the progress dialog and show it
        // Showing progress dialog
        final ProgressDialog progressDialog = new ProgressDialog(HistoryScreenActivity.this, R.style.ProgressBarTansparent);
        progressDialog.setIndeterminate(true);
        progressDialog.setCancelable(false);
        progressDialog.show();
        progressDialog.setContentView(R.layout.custom_progressbar_layout);

        String url = WebServices.GET_DETAILS_WEB_SERVICE;

        JSONObject jsonObjectChield = new JSONObject();
        try {
            jsonObjectChield.put("PUID", uID);
            jsonObjectChield.put("POID", oID);
            jsonObjectChield.put("POPF", "html");
        } catch (JSONException e) {
            e.printStackTrace();
        }

        String jsonString = jsonObjectChield.toString();
        Log.d("Params","" + jsonString);

        final JsonObjectRequest postRequest = new JsonObjectRequest(Request.Method.POST, url, jsonObjectChield, new Response.Listener&lt;JSONObject&gt;() {
            @Override
            public void onResponse(JSONObject response) {
                writeToFile(response.toString());

                webViewHistoryDetails.setVisibility(View.VISIBLE);

                File file = new File("" + path);
                webViewHistoryDetails.loadUrl("file:///" + file + "/report.html");
                progressDialog.dismiss();
            }
        }
        // Request a string response from the provided URL.
        , new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError error) {
                // Handle your error types accordingly.For Timeout &amp; No connection error, you can show 'retry' button.
                // For AuthFailure, you can re login with user credentials.
                // In this case you can check how client is forming the api and debug accordingly.
                // For ServerError 5xx, you can do retry or handle accordingly.
                if (error instanceof NetworkError) {
                    Toast.makeText(HistoryScreenActivity.this, "No internet connection", Toast.LENGTH_SHORT).show();
                } else if (error instanceof ServerError) {
                    Toast.makeText(HistoryScreenActivity.this, "Our server is busy please try again later", Toast.LENGTH_SHORT).show();
                } else if (error instanceof AuthFailureError) {
                    Toast.makeText(HistoryScreenActivity.this, "AuthFailure Error please try again later", Toast.LENGTH_SHORT).show();
                } else if (error instanceof ParseError) {
                    Toast.makeText(HistoryScreenActivity.this, "Parse Error please try again later", Toast.LENGTH_SHORT).show();
                } else if (error instanceof NoConnectionError) {
                    Toast.makeText(HistoryScreenActivity.this, "No connection", Toast.LENGTH_SHORT).show();
                } else if (error instanceof TimeoutError) {
                    Toast.makeText(HistoryScreenActivity.this, "Server time out please try again later", Toast.LENGTH_SHORT).show();
                }
                error.printStackTrace();
                progressDialog.dismiss();
            }
        }) {
            @Override
            public Map&lt;String, String&gt; getHeaders() throws AuthFailureError {
                HashMap&lt;String, String&gt; headers = new HashMap&lt;String, String&gt;();
                headers.put("Content-Type", "application/json");
                // headers.put("Authorization", "Basic c2NvdHQ6dGlnZXI=");
                headers.put("token-id", sToken);
                String creds = String.format("%s:%s", "scott", "tiger");
                String auth = "Basic " + Base64.encodeToString(creds.getBytes(), Base64.DEFAULT);
                headers.put("Authorization", auth);
                Log.d("SToken",sToken);

                // String creds = String.format("%s:%s", "scott", "tiger");
                // String auth = "Basic " + Base64.encodeToString(creds.getBytes(), Base64.DEFAULT);
                // headers.put("Authorization", auth);
                return headers;
            }
        };

        Volley.newRequestQueue(HistoryScreenActivity.this).add(postRequest);

    }
</code></pre>

<p>i am getting this error </p>

<p><img src="https://i.stack.imgur.com/uph2g.png" alt="Log cat error"></p>

<p>this is response i am getting in this webservice:</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Order Details&lt;/title&gt;
&lt;style&gt;
body
table td{
    font-family: "Roboto Condensed", sans-serif;
    color: #656565;
    font-size: 14px;
}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;table style="width:100%; cellpadding:0; cellspacing:1;"&gt;
    &lt;tr style="background:#CDDDF7;"&gt;
        &lt;td style="text-align:center; padding:20px; font-weight:bold; font-size:22px;"&gt;Order&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;
            &lt;table cellpadding="6" style="width:100%; cellpadding:0; cellspacing:1; background:#F7F7FF; border:1px solid #BEC0CC; border-radius:3px 3px 0px 0px;  padding-bottom:15px;"&gt;
            &lt;tbody&gt;
                &lt;tr style="padding-bottom:10px; background-color:#ccc;"&gt;
                    &lt;td style="background-color:F7F7FF; width:20%; font-weight:bold;"&gt;
                        Order Number 
                    &lt;/td&gt;
                    &lt;td style="background-color:F7F7FF; width:30%;"&gt;
                        67
                    &lt;/td&gt;
                    &lt;td style="background-color:F7F7FF; width:20%; font-weight:bold;"&gt;
                        Order Date 
                    &lt;/td&gt;
                    &lt;td style="background-color:F7F7FF; width:30%;"&gt;
                        2016-07-14
                    &lt;/td&gt;
                &lt;/tr&gt;
                &lt;tr&gt;
                    &lt;td style="background-color:F7F7FF; width:20%; font-weight:bold;"&gt;
                        Customer Name
                    &lt;/td&gt;
                    &lt;td style="background-color:F7F7FF; width:30%;"&gt;
                        Optim India
                    &lt;/td&gt;
                    &lt;td style="background-color:F7F7FF; width:20%; font-weight:bold;"&gt;
                        Cook Name
                    &lt;/td&gt;
                    &lt;td style="background-color:F7F7FF; width:30%;"&gt;
                        Kuldeep Sonawane
                    &lt;/td&gt;
                &lt;/tr&gt;
                &lt;tr&gt;
                    &lt;td style="background-color:F7F7FF; width:20%; font-weight:bold;"&gt;
                        Customer Email
                    &lt;/td&gt;
                    &lt;td style="background-color:F7F7FF; width:30%;"&gt;
                        ***id@gmail.com
                    &lt;/td&gt;
                    &lt;td style="background-color:F7F7FF; width:20%; font-weight:bold;"&gt;
                        Cook Email
                    &lt;/td&gt;
                    &lt;td style="background-color:F7F7FF; width:30%;"&gt;
                        ***id@gmail.com
                    &lt;/td&gt;
                &lt;/tr&gt;
                &lt;tr&gt;
                    &lt;td style="background-color:F7F7FF; width:20%; font-weight:bold;"&gt;
                        Customer Contact Number
                    &lt;/td&gt;
                    &lt;td style="background-color:F7F7FF; width:30%; vertical-align:top;"&gt;
                        9876******
                    &lt;/td&gt;
                    &lt;td style="background-color:F7F7FF; width:20%; font-weight:bold; vertical-align:top;"&gt;
                        cook Contact Number
                    &lt;/td&gt;
                    &lt;td style="background-color:F7F7FF; width:30%; vertical-align:top;"&gt;
                        9658******
                    &lt;/td&gt;
                &lt;/tr&gt;
                &lt;tr&gt;
                    &lt;td style="background-color:F7F7FF; width:20%; font-weight:bold; vertical-align:top;"&gt;
                        order status
                    &lt;/td&gt;
                    &lt;td style="background-color:F7F7FF; width:30%;"&gt;
                        Accepted
                    &lt;/td&gt;
                    &lt;td style="background-color:F7F7FF; width:20%; font-weight:bold; vertical-align:top;"&gt;
                        Delivery Address
                    &lt;/td&gt;
                    &lt;td style="background-color:F7F7FF; width:30%; vertical-align:top;"&gt;
                        clg rd, city - Carlsbad, state - California, country - United States, zip code - 422008
                    &lt;/td&gt;
                &lt;/tr&gt;
            &lt;/tbody&gt;
            &lt;/table&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;
        &lt;table cellpadding="4" cellspacing="0" style="width:100%; background:#F7F7FF; border:1px solid #BEC0CC; border-top:0!important; border-radius:0 0 3px 3px;"&gt;
        &lt;tbody&gt;
            &lt;tr style="font-weight:bold;background-color:#CDDDF7;"&gt;
                &lt;td&gt;
                    Sr.
                &lt;/td&gt;
                &lt;td &gt;
                    Dish Name
                &lt;/td&gt;
                &lt;td style="text-align:right;"&gt;
                    Quantity
                &lt;/td&gt;
                &lt;td style="text-align:right;"&gt;
                    Rate
                &lt;/td&gt;
                &lt;td style="text-align:right;"&gt;
                    Discount
                &lt;/td&gt;
                &lt;td style="text-align:right;"&gt;
                    Amount
                &lt;/td&gt;
            &lt;/tr&gt;&lt;tr style="background-color:#fff;"&gt;
                    &lt;td style="text-align:center;"&gt;
                        1
                    &lt;/td&gt;
                    &lt;td&gt;
                        Chicken Tikka Masala
                    &lt;/td&gt;
                    &lt;td style="text-align:right;"&gt;
                        4
                    &lt;/td&gt;
                    &lt;td style="text-align:right;"&gt;
                        25000
                    &lt;/td&gt;
                    &lt;td style="text-align:right;"&gt;
                        0
                    &lt;/td&gt;
                    &lt;td style="text-align:right;"&gt;
                        100000
                    &lt;/td&gt;
                &lt;/tr&gt;&lt;tr style="background-color:#fff;"&gt;
                &lt;td style="border-top:1px solid #ccc;" colspan="4"&gt;&lt;/td&gt;
                &lt;td style="border-top:1px solid #ccc;"&gt;
                    &lt;b&gt;Sub Total&lt;/b&gt;
                &lt;/td&gt;
                &lt;td style="border-top:1px solid #ccc; text-align:right;"&gt;
                    100000
                &lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
                &lt;td style="border-top:1px solid #ccc;" colspan="4"&gt;&lt;/td&gt;
                &lt;td style="background-color:F7F7FF; font-weight:bold;border-top:1px solid #ccc;"&gt;
                    &lt;b&gt;Total&lt;/b&gt;
                &lt;/td&gt;
                &lt;td style="background-color:F7F7FF; font-weight:bold; border-top:1px solid #ccc; text-align:right;"&gt;
                    100000
                &lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
                &lt;td style="border-top:1px solid #ccc;" colspan="4"&gt;&lt;/td&gt;
                &lt;td style="background-color:F7F7FF; font-weight:bold;border-top:1px solid #ccc;"&gt;
                    &lt;b&gt;Total Discount&lt;/b&gt;
                &lt;/td&gt;
                &lt;td style="background-color:F7F7FF; font-weight:bold; border-top:1px solid #ccc; text-align:right;"&gt;
                    0
                &lt;/td&gt;
            &lt;/tr&gt;
        &lt;/tbody&gt;
        &lt;/table&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>