C#C
C#β€’4y ago
AchSteff

HTTP Post query

I am currently learning the post query using HTTP from the https://ptsv2.com page.

My question is whether what I get in my textbox makes sense as far as it goes, or whether I've just written garbage after all.

so, this was the code
            try
            {
                using (var client = new HttpClient())
                {
                    var urlString = new Uri("https://ptsv2.com");
                    var newToilet = new HeadersMain();
                    var newToiletJson = JsonConvert.SerializeObject(newToilet);
                    var load = new StringContent(newToiletJson, Encoding.UTF8, "application/json");
                    var result = client.PostAsync("https://ptsv2.com/t/" + textBox1.Text + "/post", load).Result;
                    richTextBox1.Text = result.ToString();
                }
            }
unknown.png
Was this page helpful?