I am trying to read image data from a third party RESTful API. The problem that I am running is the data is being returned in a data structure with the content type of "application/json".
Is it possible to retrieve the image and convert it to a jpeg after parsing out the rest of the json to get the image string itself?
The string begins with the following characters -> ����\u0000\u0010JFIF
I've tried the following, but the image comes out unviewable.
var data = JsonConvert.DeserializeObject<ImageReturn>(response.Content);
var img = data.record[0].tables.photo.imagedata;
var bytes = Encoding.UTF32.GetBytes(img);
var file = System.IO.File.Create(@"C:\Users\example\Desktop\test.jpeg");
Where imagedata is being deserialized as a string initially.