Sending a POST request with a string payload using System.Net.WebClient

suggest change
string requestUri = "";
string requestBodyString = "Request body string.";
string contentType = "text/plain";
string requestMethod = "POST";
byte[] responseBody;    
byte[] requestBodyBytes = Encoding.UTF8.GetBytes(requestBodyString);

using (var client = new WebClient())
    client.Headers[HttpRequestHeader.ContentType] = contentType;
    responseBody = client.UploadData(requestUri, requestMethod, requestBodyBytes);

Feedback about page:

Optional: your email if you want me to get back to you:

Table Of Contents