Advertisement
mbazs

.NET C# HttpClient null bytes

Dec 3rd, 2015
484
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.46 KB | None | 0 0
  1. using (HttpClient client = new HttpClient()) {
  2.     StringContent sc = new StringContent(string.Empty);
  3.     Task<HttpResponseMessage> resultTask = client.PostAsync(Server + "/p03c-ws/ovf2/" + SessionId, sc);
  4.     resultTask.Wait(HttpTimeoutMs);
  5.     using (HttpResponseMessage resp = resultTask.Result)
  6.     using (HttpContent cnt = resp.Content) {
  7.         return new HibakodokLista(DecodeDataXML<Ovf2.ovfHibakodok>(cnt.ReadAsStreamAsync().Result)).HIBAKODOK;
  8.     }
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement