title: NetFramework convert to Net Core (HttpWebRequest)
body: <p>I have a library for 4.5 net fw. I need do the same but for net core.</p>
  
  <p>Big beer for person which can repair this..</p>
  
  <p><a href="https://i.stack.imgur.com/OL9cr.png" rel="nofollow noreferrer">Code from VS with errors (screen)</a>
  MY code:</p>
  
  <pre><code>string returnData = String.Empty;
  
              var webRequest = HttpWebRequest.Create(url) as HttpWebRequest;
              if (webRequest != null)
              {
                  webRequest.Accept = "*/*";
                  webRequest.UserAgent = ".NET";
                  webRequest.Method = method;
                  webRequest.ContentType = "application/json";
                  webRequest.Host = "coinbase.com";
  
                  string nonce = Convert.ToInt64(DateTime.Now.Ticks).ToString();
                  string message = nonce + url;
                  string signature = HashEncode(HashHMAC(StringEncode(API_SECRET), StringEncode(message)));
  
                  var whc = new WebHeaderCollection();
                  whc.Add("ACCESS_KEY: " + API_KEY);
                  whc.Add("ACCESS_SIGNATURE: " + signature);
                  whc.Add("ACCESS_NONCE: " + nonce);
                  webRequest.Headers = whc;
  
                  using (WebResponse response = webRequest.GetResponse())
                  {
                      using (Stream stream = response.GetResponseStream())
                      {
                          StreamReader reader = new StreamReader(stream);
                          returnData = reader.ReadToEnd();
                      }
                  }
              }
  </code></pre>