okhttp get failure response
<p>I've implemented okhttp in my android client for network calls.</p>

<p>When i get a failure response i get the failure code and the text related to the code as a message but i don't get the custom failure response that the server sends me.
In my failure response in the implemented code the message i get is just "Bad Request".</p>

<p>Whereas the same response from the browser is as follows.
<a href="https://i.stack.imgur.com/8upYB.png" rel="noreferrer"><img src="https://i.stack.imgur.com/8upYB.png" alt="enter image description here"></a></p>

<p>How do i get the error message the server is giving me back?</p>

<p>My code</p>

<pre><code>private void executeCall(Request request, final ResponseListener listener) {
        mOKHttpClient.newCall(request)
                     .enqueue(new Callback() {
                         @Override
                         public void onFailure(Call call, IOException e) {                              
                             postFailure(listener, (String) call.request()
                                                                .tag(),e.toString());
                         }

                         @Override
                         public void onResponse(Call call, final Response response) throws IOException {
                             if(response.isSuccessful()) {
                                 String responseString = response.body().string();                                   
                                 postSuccess(listener, (String)call.request().tag(), responseString);
                             }
                             else {                                 
                                 postFailure(listener, (String)call.request().tag(),response.code()+","+response.message());
                             }
                         }
                     });
    }
</code></pre>

<p>Here's my response in case of failure.
<a href="https://i.stack.imgur.com/71zj1.png" rel="noreferrer"><img src="https://i.stack.imgur.com/71zj1.png" alt="enter image description here"></a></p>