1
Vote

Unit of Range header changes when sent to server

description

If I create a request and use HttpClient to send to a server, value of the Unit changes to "bytes" regardless of the value set:

request = new HttpRequestMessage(HttpMethod.Get, "http://localhost:50714/api/Car"); request.Headers.Range = new RangeHeaderValue(1, 2) { Unit = "foo" };
httpResponseMessage = httpClient.SendAsync(request).Result;

Server always gets "bytes" as unit. On client, however, value showing as correct value.

comments

HongmeiG wrote Aug 10, 2012 at 11:04 PM

Can you send a complete standalone repro for this issue? Web API does not special case RangeHeaderValue. it is up to the server developer how to use this.