Skip to main content

Windows Dev Center

HttpContentHeaderCollection.ContentRange | contentRange property

Gets or sets the HttpContentRangeHeaderValue object that represent the value of an HTTP Content-Range header on the HTTP content.

Syntax


var contentRange = httpContentHeaderCollection.contentRange;
httpContentHeaderCollection.contentRange = contentRange;

public HttpContentRangeHeaderValue ContentRange { get; set; }

Public Property ContentRange As HttpContentRangeHeaderValue

public:
property HttpContentRangeHeaderValue^ ContentRange { 
   HttpContentRangeHeaderValue^ get();
   void set (HttpContentRangeHeaderValue^ value);
}

Property value

Type: HttpContentRangeHeaderValue

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.

Remarks

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());
    }

Requirements (Windows 10 device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.Web.Http.Headers
Windows::Web::Http::Headers [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8.1

Minimum supported server

Windows Server 2012 R2

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

Windows.Web.Http.Headers
Windows::Web::Http::Headers [C++]

Metadata

Windows.winmd

See also

HttpContentHeaderCollection
HttpContentRangeHeaderValue