Exemplo n.º 1
0
        protected static async Task <T> PatchRequestToApi <T>(string requestUri, T model)
        {
            var json     = JsonConvert.SerializeObject(model);
            var response = await HttpRequestFactory.Patch(requestUri, model);

            return(response.ContentAsType <T>());
        }
Exemplo n.º 2
0
 private static async Task Patch()
 {
     var model = new[]
     {
         new
         {
             op    = "replace",
             path  = "/title",
             value = "thdetail"
         }
     };
     var reqeustUrl = $"{baseUrl}/4";
     var response   = await HttpRequestFactory.Patch(reqeustUrl, model);
 }
Exemplo n.º 3
0
        private static async Task Patch()
        {
            var model = new[]
            {
                new
                {
                    op    = "replace",
                    path  = "/title",
                    value = "Thunderball-Patch"
                }
            };

            var requestUri = $"{baseUri}/4";
            var response   = await HttpRequestFactory.Patch(requestUri, model);

            Console.WriteLine($"Status: {response.StatusCode}");
        }
Exemplo n.º 4
0
 public async Task PatchWorks()
 {
     var data = new MockData();
     await HttpRequestFactory.Patch("https://jsonplaceholder.typicode.com/posts/1", data);
 }