'is it possible to get response of previewed Pdf in Retrofit android?

I am getting 500 from response but in postman its showing 200

response that I am getting in body

Headers

My ApiInterface

@Streaming
@GET("SaleReport")
@Headers({"Content-Type: application/pdf"})
Call<ResponseBody> getReport(@Header("Authorization") String token, @Query("SaleId") String saleId);

Retrofit Call

private void getSalesReport(String saleId) {
    if (saleId != null) {
        Toast.makeText(this, "" + saleId, Toast.LENGTH_SHORT).show();
        ApiClient.getInstance(this).getApi().getReport("Bearer " + Constant.Token, saleId)
                .enqueue(new Callback<ResponseBody>() {
                    @Override
                    public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
                        if (response.isSuccessful()) {
                            Log.e("PDF","Success");
                        } else {
                            Log.e("PDF",""+response.code());
                        }
                    }

                    @Override
                    public void onFailure(Call<ResponseBody> call, Throwable t) {
                        Log.e("PDF", "" + t.toString());
                    }
                });
    } else {
        Toasty.error(getApplicationContext(), "SaleId Required", Toasty.LENGTH_SHORT).show();
    }
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source