コード例 #1
0
        public async void Can_have_resulting_entity_with_Post_HttpRequester()
        {
            using (var requester = new HttpRequester(DbUrl).Configure(cfg => cfg.WithBasicAuthorization(U, P)))
            {
                var db = await requester.PutAsync();

                db.TheResponse(should => should.BeSuccessful());

                var newDoc = await requester.PostJsonAsync <dynamic>("{\"value\":\"one\"}");

                newDoc.TheResponse(should => should.BeSuccessful());

                string id = newDoc.Content.id;

                var putDoc = await requester.PutJsonAsync <dynamic>("{\"value\":\"two\"}", $"{id}?rev={newDoc.ETag}");

                putDoc.TheResponse(should => should.BeSuccessful());
            }
        }