HttpStatus and DownloadData

c#, restsharp

Solution

The image data would be in `RestResponse.RawBytes`

Problem

I'm trying to download a file (an image) with RestSharp using the DownloadData method ``` var client = new RestClient(baseUrl); var request = new RestRequest("GetImage", Method.GET); var response = client.DownloadData(request); ``` This works fine, but if the requests returns an error I cannot see the HttpStatus code. I could make a Request and check the status: ``` var client = new RestClient(baseUrl); var request = new RestRequest("GetImage", Method.GET); var response = client.Execute(request); var status = response.StatusCode; ``` But then I cannot get the image from the Content property. I'm I missing something obvious?

Original source