4.7.1 Retrieving a Named Resource Stream Instance

To retrieve a named resource stream instance, a client issues an HTTP GET request against the named resource stream self-link.

To acquire a named resource stream self-link, a client can issue a request as described in section 4.2.1.7 for AtomPub, in Stream Property in [ODataJSON4.0] section 9 for JSON, or in section 4.2.1.8 for Verbose JSON. And, a client can interpret the response according to the rules that are specified in section 2.2.6.2.10 for AtomPub, in Stream Property in [ODataJSON4.0] section 9 for JSON, or in section 2.2.6.3.14 for Verbose JSON.

A client sets the Accept header value to the ContentType of the named resource stream instance.

A clients sets both the DataServiceVersion and the MaxDataServiceVersion of header values to 2.0 or higher.

When the server responds, the response header contains the current DataServiceVersion.

HTTP Request:

        GET /Photos(1)/SampleModel.Photo/Thumbnail HTTP/1.1
        Host: host
        Accept: image/png
        DataServiceVersion: 1.0
        MaxDataServiceVersion: 3.0

HTTP Response:

        HTTP/1.1 200 OK
        Date: Fri, 11 Oct 2008 04:23:49 GMT
        Content-Length: ####
        DataServiceVersion: 1.0  
  
        ...binary data for the png thumbnail ...

If the server returns an ETag for the named resource stream instance and the client opts to retrieve the stream only when the known ETag no longer represents the current version, the client includes the ETag with the request in the If-None-Match (section 2.2.5.6) header.

Servers that do support the If-None-Match header return the stream only when it has been modified because the version represented by the ETag specified in the If-None-Match header is no longer the current version.