Got the solution:
instead of
mybytearray= response.Content.ReadAsByteArrayAsync().Result;
I am doing:
string result=null;
result = response.Content.ReadAsStringAsync().Result.Replace("\"", string.Empty);
mybytearray=Convert.FromBase64String(result);
The key point is:
It was returning the byte array as base64encoded.