SHARE
TWEET

Untitled

a guest Jul 19th, 2019 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. string contentJson = JsonConvert.SerializeObject(content);
  2. HttpRequestMessage httpRequest = new HttpRequestMessage(HttpMethod.Patch, baseUrl);
  3. HttpClient client = _clientFactory.CreateClient();
  4. httpRequest.Content = new StringContent(contentJson, Encoding.UTF8, "application/json-patch+json");
  5. httpRequest.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json-patch+json"));
  6. httpRequest.Headers.Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(Encoding.UTF8.GetBytes($"{yourusername}:{yourpwd}")));
  7. HttpResponseMessage response = await client.SendAsync(httpRequest);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top