-api-id | -api-type |
---|---|
P:Windows.Web.Http.Headers.HttpContentHeaderCollection.ContentRange |
winrt property |
Gets or sets the HttpContentRangeHeaderValue object that represent the value of an HTTP Content-Range header on the HTTP content.
The object that represent the value of the HTTP Content-Range header on the HTTP content. A null value means that the header is absent.
The following sample code shows a method to get or set the Content-Range header value on HTTP content using the ContentRange property on the HttpContentHeaderCollection object.
// Content-Range header
// HttpContentRangeHeaderValue (Unit=string, FirstBytePosition, LastBytePosition, Length) all nullable ulong
//
void DemoContentRange(IHttpContent content) {
var h = content.Headers;
h.ContentRange = new HttpContentRangeHeaderValue (10, 20, 333);
var header = h.ContentRange;
uiLog.Text += "\nCONTENT RANGE HEADER\n";
uiLog.Text += string.Format("ContentRange: Unit: {0} FirstBytePosition: {1} LastBytePosition: {2} Length: {3} ToString: {4}\n\n", header.Unit, header.FirstBytePosition, header.LastBytePosition, header.Length, header.ToString());
}