how to get response body in okhttp when code is 401
问题 i am using okHttp 3.2.0 and here is code for building request object MediaType JSON = MediaType.parse(AppConstants.CONTENT_TYPE_VALUE_JSON); RequestBody body = RequestBody.create(JSON, requestBody); HttpUrl url = new HttpUrl.Builder() .scheme("http") .host("192.168.0.104") .port(8080) .addPathSegment("mutterfly-server") .addPathSegment("j_spring_security_check") .addQueryParameter("j_username", jsonObject.getString("emailId")) .addQueryParameter("j_password", jsonObject.getString("password"))