I have this HttpWebRequest:
var request = HttpWebRequest.Create("http://example.com/api/Phrase/GetJDTO"); request.ContentType = "application/json"; request.Method = "POST"; But I need to add a payload to the body of the request like this:
Jlpt = 2 Can someone help and tell me how I can add data to the POST ?
HttpClientrather thanHttpWebRequest. It has a more modern, asynchronous API, and a much more straightforward way to add a payload to a request.