Show Image in Android as a result of REST API Respone Header

My REST API is returning an image in the header (‘Content-Type’, ‘image/png’). The image is stored as binary in SQL Server (data type: picture, stored in binary format). API’s response is perfect as I have checked in Postman.
I want to display that image in Android. (I am using volley for Network requests.)
Any thoughts?
Thank you in advance.

Here is my slim REST API route that returns the image.

//get image
 $app->get('/image', function ($request, $response) {
$conn = new PDO('sqlsrv:server =localhost; Database = dbName', 'dbUser', 'dbPass');
$sql = "SELECT Picture 
        FROM Table
        WHERE Primary_Key = 'abc'";

$statement = $conn->prepare($sql);
$row = $statement->fetch(PDO::FETCH_ASSOC);
return $response->withHeader('Content-Type', 'image/png')->write($row['Picture']);}

Here is my API get request call using volley at Android end. This code resides in a Fragment. url is a String variable, profileImage is an ImageView where I want to use that fetched image.

url= getString(R.string.api_url) + "image";
    request = new StringRequest(GET, url, new Response.Listener<String>() {
        public void onResponse(String response) {

            byte[] byteArray = response.getBytes();
            Bitmap bitmap = 
        } //onErrorResponse
    }, new Response.ErrorListener() {
        public void onErrorResponse(VolleyError error) {
    }) {
    queue = Volley.newRequestQueue(getActivity());


After doing a lot of effort, I came to conclusion that this question is possible duplicate of How to download an Image by using Volley?

I replaced the value of url = ““; with my API GET request and result is perfectly as desired.

Here is the code from that question thread.

ImageView mImageView;
String url = "";
mImageView = (ImageView) findViewById(;

// Retrieves an image specified by the URL, displays it in the UI.
ImageRequest request = new ImageRequest(url,
new Response.Listener<Bitmap>() {
    public void onResponse(Bitmap bitmap) {
}, 0, 0, null,
new Response.ErrorListener() {
    public void onErrorResponse(VolleyError error) {
// Access the RequestQueue through your singleton class.

Thank you all for helping.