Exemple #1
0
        protected virtual HttpRequestMessage CreateRequest(GetAttachmentCommand cmd)
        {
            var req = new HttpRequest(HttpMethod.Get, GenerateRequestUrl(cmd.DocId, cmd.DocRev, cmd.Name));

            req.SetIfMatch(cmd.DocRev);

            return req;
        }
Exemple #2
0
        public virtual async Task<AttachmentResponse> GetAsync(GetAttachmentCommand cmd)
        {
            Ensure.That(cmd, "cmd").IsNotNull();

            var req = CreateRequest(cmd);
            var res = SendAsync(req);

            return ProcessAttachmentResponse(await res.ForAwait());
        }