コード例 #1
0
        public async Task <byte[]> GetBinaryFileAsync(string container, string filepath)
        {
            if (container == null)
            {
                throw new ArgumentNullException("container");
            }

            if (filepath == null)
            {
                throw new ArgumentNullException("filepath");
            }

            IHttpAddress address = baseAddress.WithResource(container, filepath);
            IHttpRequest request = new HttpRequest(HttpMethod.Get, address.Build(), baseHeaders.Include(HttpHeaders.AcceptHeader, OctetStream));

            IHttpResponse response = await httpFacade.RequestAsync(request);

            HttpUtils.ThrowOnBadStatus(response, contentSerializer);

            return(response.RawBody);
        }