title: How to send HTTP DELETE Request via C# WebClient?
body: <p>After logging in I can have a token from my remote system. For example the authentication_token is 8JySqFVx_pKx_3nx67AJ
  I can log out from terminal via this command</p>
  
  <pre><code>curl -v -H 'Content-Type: application/json' -H 'Accept: application/json' -X DELETE https://sample.com\?authentication_token\=8JySqFVx_pKx_3nx67AJ
  </code></pre>
  
  <p>I need to do it from C#.
  I can send POST request like this:</p>
  
  <pre><code>        WebClient wc = new WebClient();
          string baseSiteString = wc.DownloadString("https://sample.com");
          string csrfToken = Regex.Match(baseSiteString, "&lt;meta name=\"csrf-token\" content=\"(.*?)\" /&gt;").Groups[1].Value;
          string cookie = wc.ResponseHeaders[HttpResponseHeader.SetCookie];
  
          wc.Headers.Add(HttpRequestHeader.Cookie, cookie);
          wc.Headers.Add(HttpRequestHeader.ContentType, "application/json; charset=utf-8");
          wc.Headers.Add(HttpRequestHeader.Accept, "application/json, text/javascript, */*; q=0.01");
          wc.Headers.Add("X-CSRF-Token", csrfToken);
          wc.Headers.Add("X-Requested-With", "XMLHttpRequest");
  
  
          string dataString  =  @"{""user"":{""email"":""sample@sample.com"",""password"":""sample_password""}}";
          byte[] dataBytes = Encoding.UTF8.GetBytes(dataString);
          byte[] responseBytes = wc.UploadData(new Uri("https://sample.com/auth.json"), "POST", dataBytes);
          string responseString = Encoding.UTF8.GetString(responseBytes);
  </code></pre>
  
  <p>How Can I send DELETE request from C# where authentication_token would be a parameter?</p>