Dell DX6004S DX Object Storage Application Guide - Page 18
Handling Redirects, 6. Using Range Headers
View all Dell DX6004S manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 18 highlights
Most of these client libraries will take care of the low-level protocol issues for you. Formatting the requests and interpreting the responses are usually much easier with an existing framework. In fact, much of the SCSP discussion above can be skipped, allowing the framework to do the work for you. 3.5. Handling Redirects Some HTTP client libraries and frameworks do not handle redirects correctly for WRITE requests, at least not by default. Older versions of the HTTP protocol, namely HTTP/1.0, were lax in their specification of exactly what the client must do when it receives a 301 or a 307 response code. Because of this, older clients, including many web browsers, developed their own conventions. While some of these conventions might be useful, they are in direct violation of the HTTP/1.1 specification and therefore incompatible with DX Storage. Both the Microsoft .NET framework and the libCURL framework (and probably others) are known to process a redirect from a POST request by changing the POST to a GET and then sending the new request to the redirect server. Workarounds exist in the impacted frameworks because the behavior is known to be in violation of the specification. To quote RFC 2616: "When automatically redirecting a POST request after receiving a 301 status code, some existing HTTP/1.0 user agents will erroneously change it into a GET request." 3.6. Using Range Headers In some cases, an application might be interested in only a byte portion of a larger object stored in DX Storage. Rather than read the entire object and filter out the interesting parts, the application can include one or more Range headers with an SCSP READ request. A READ request can include more than one Range header. Consult the HTTP/1.1 specification for a thorough discussion of Range headers. Here are some examples and their interpretations: Range: 0-499 Return the first 500 bytes of the object Range: 500-999 Return the second 500 bytes Range: -500 Return the last 500 bytes Range: 0-499, 500-999 Return the first 1000 bytes Note Range headers are not compatible with integrity seals because an integrity seal is a hash of the object's entire contents. If the Range is not set to a value greater than or equal to the size of the object, the connection is closed as if the integrity seal was invalid. For more information about integrity seals, see Section 20.1, "Integrity Seals". READ requests that include invalid Range headers (for example, ranges that do not exist in the object) cause DX Storage to respond with a 416 Range not satisfiable error. A successful response to a READ that includes one or more Range headers is 206 Partial content. Of course, only data in the requested ranges are included in the 206 response. READ requests that include a range like Range: 0-199, 300-349, 500-999 returns a Content-Type: multipart/byteranges response consisting of three parts: 200, 50, and 500 bytes of content. For more information, see section 14.35 (Range) and appendix 19.2 (Internet Media Type multipart/ byteranges) in the HTTP/1.1 RFC. Copyright © 2010 Caringo, Inc. All rights reserved 13 Version 5.0 December 2010