Can't add Range header in RestSharp request

516 views Asked by At

I execute following request using RestSharp

var request = new RestRequest("downloadDocument", Method.GET);
var id = 288148748;
request.AddParameter("id", id);
request.AddHeader("Custom-Header", "blablabla");
request.AddHeader("Accept", "*/*");
request.AddHeader("Range", "bytes=59000-");
var response = client.Execute(request);

I inspect request using Fiddler and I see that all headers all visible except Range. Why?

enter image description here

1

There are 1 answers

0
myshon On

I solved issue. RestSharp requires Range with from-to parameters e.g "Range: bytes-59000-63000. RestSharp does not add headers like "Range: bytes=59000-" (which is valid for curl).