I am using my client to get info about a file stored in my Swift Object Storage which can be accessed through a REST API. In Swift the HEAD method and URL leading to the object returns its metadata (hash, timestamp, etc.) contained in the HTML response's (has no content) headers. My code works when file size is < 2GB. I get the HttpResponseMessage and am able to parse it for data, but with a file > 2GB I get:
Cannot write more bytes to the buffer than the configured maximum buffer size: 2147483647
The HttpClient.MaxResponseContentBufferSize property cannot be set to a value > 2GB but I don't want its content. Is there a way to solve this?
public HttpResponseMessage FileCheckResponse(string objectName) {
//create url which will be appended to HttpClient (m_client)
string requestUrl = RequestUrlBuilder(m_containerName, objectName);
//create request message with Head method
HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Head, requestUrl);
//exception thrown here...
HttpResponseMessage response = m_client.SendAsync(request).Result;
return response;
}
The same action using Dev HTTP Client (Chrome extension) has no problem. It seems the Content-Length header makes it unfeasible. Output from Dev HTTP Client:
Content-Length: 3900762112
Accept-Ranges: bytes
Last-Modified: Fri, 06 Sep 2013 16:24:30 GMT
Etag: da4392bdb5c90edf31c14d008570fb95
X-Timestamp: 1378484670.87557
Content-Type: application/octet-stream
Date: Tue, 10 Sep 2013 13:25:27 GMT
Connection: keep-alive