title: How can I send a POST request to Discord Webhooks C#
body: <p>So I'm making a FiveM resource, that gets a message and then sends it to Discord channel. I'm need it to be server-sided script.</p>
  
  <p>I've tried using WebClient, Flurl.Http and some async, await stuff, but none of them work</p>
  
  <p>I have tried this WebClient</p>
  
  <pre><code>using (var wb = new WebClient())
               {
                   string content = message;
                   string username = "" + name + "(ID: )" + id;
  
                   var data = new NameValueCollection();
                   data["username"] = username;
                   data["content"] = content;
  
                   var response = wb.UploadValues(discordURL, "POST", data);
                   string responseInString = Encoding.UTF8.GetString(response);
                   Debug.WriteLine(responseInString);
               }
  </code></pre>
  
  <p>I have tried using the async, await with Dictionary</p>
  
  <pre><code>var values = new Dictionary&lt;string, string&gt;
              {
                 { "username", name + " ID: " + id },
                 { "content", message }
              };
  
              var content = new FormUrlEncodedContent(values);
  
              var response = await client.PostAsync(discordURL, content);
  
              var responseString = await response.Content.ReadAsStringAsync();
  </code></pre>
  
  <p>And for the final time, I have tried using Flurl.Http</p>
  
  <pre><code>var responseString = await discordURL
              .PostUrlEncodedAsync(new { username = name + " ID: " + id, content = message })
              .ReceiveString();
  </code></pre>
  
  <p>Flurl.Http when using returns, that the dependency can't be found and the others just lag the entire FiveM chat resource and doesn't do anything.</p>
  
  <p>If you could help me, it would be the best, thank you.</p>