Getting Null exception
try
{
var contentBytes = APIWebservice.GetPreview(Global.AuthTicket?.Ticket, fileToken, out var fileName,
out var isAuthenticated);
if (!isAuthenticated)
return Request.CreateErrorResponse(HttpStatusCode.Unauthorized, "Not authorized");
var response = new HttpResponseMessage(HttpStatusCode.OK) {Content = new ByteArrayContent(contentBytes)};
response.Content.Headers.ContentType = MediaTypeHeaderValue.Parse(MimeMapping.GetMimeMapping(fileName));
response.Content.Headers.ContentDisposition.FileName = fileName;
response.Content.Headers.ContentDisposition.Size = contentBytes.Length;
return response;
}
Getting issue at response.Content.Headers.ContentType = MediaTypeHeaderValue.Parse(MimeMapping.GetMimeMapping(fileName));
"System.Net.Http.Headers.HttpContentHeaders.ContentDisposition.get returned null."
But the out var fileName having value.
Please..