I am trying to post a specific HTTP Post however i am not understanding the conversion for C# to do this correctly, I feel like I am most of the way there but getting stuck along the way
This is what I am trying to send:
curl -i -X POST -H 'Content-Type: application/json' -d '{"text": " Some text or a string in my case a string :tada:"}' http://example.com/hooks/KEYDATA
Should look something like this...
POST /hooks/KEYDATA HTTP/1.1
Host: http://example.com
Content-Type: application/json
Content-Length: 63
Here is what I have....
async Task sendRequest()
{
using var httpClient = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("POST"),
"https://example.com/hooks/KEYDETAIL");
request.Headers.TryAddWithoutValidation("Content-Type", "application/json");
request.Content = new StringContent("{\"text\":\" " + questionCreated + "\" :tada:\"}",
Encoding.UTF8, "application/json");
var response = await httpClient.SendAsync(request);
MessageBox.Show(request.ToString());
}