Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string contentJson = JsonConvert.SerializeObject(content);
- HttpRequestMessage httpRequest = new HttpRequestMessage(HttpMethod.Patch, baseUrl);
- HttpClient client = _clientFactory.CreateClient();
- httpRequest.Content = new StringContent(contentJson, Encoding.UTF8, "application/json-patch+json");
- httpRequest.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json-patch+json"));
- httpRequest.Headers.Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(Encoding.UTF8.GetBytes($"{yourusername}:{yourpwd}")));
- HttpResponseMessage response = await client.SendAsync(httpRequest);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement