I have an ActionContext object.
I want to read the Range header from the Request. What I know is that I can read it like this
var rangeHeader = context.HttpContext.Request.Headers["Range"]
but then I have to split the string to get range from and to values because range header comes like this byte=100-512
So is this the right way to read this header from IHeaderDictonary or is there a better way to do this?
I just found out what might be the "official" way to do it:
Add the following nuget to your project «Microsoft.AspNetCore.Http.Extensions».
And then do this:
And you're done :)