Guest User

Untitled

a guest
Feb 19th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. using (HttpClient client = GetClient(cServerBaseAddress))
  2. {
  3. using (HttpResponseMessage response = await client.PostAsync(url, new ByteArrayContent(File.ReadAllBytes(cFilename))))
  4. {
  5. responseContent = await response.Content.ReadAsStringAsync();
  6. response.EnsureSuccessStatusCode();
  7. string newContentId = Newtonsoft.Json.Linq.JToken.Parse(
  8. response.Content.ReadAsStringAsync().Result).ToString();
  9. return newContentId;
  10. }
  11. }
Add Comment
Please, Sign In to add comment