protected virtual HttpRequestMessage CreateRequest(PutDocumentCommand cmd) { var req = new HttpRequest(HttpMethod.Put, GenerateRequestUrl(cmd.Id, cmd.Rev)); req.SetIfMatch(cmd.Rev); req.SetContent(cmd.Content); return req; }
public virtual async Task<DocumentHeaderResponse> PutAsync(PutDocumentCommand cmd) { Ensure.That(cmd, "cmd").IsNotNull(); var req = CreateRequest(cmd); var res = SendAsync(req); return ProcessDocumentHeaderResponse(await res.ForAwait()); }