may I have a example for Get HTTP GET request in C#?

Unfortunately I found only Powershell and Python in Google https://blog.paessler.com/how-to-monitor-server-room-temperature-with-prtg-on-a-budget https://www.msxfaq.de/tools/prtg/prtghttppushsensoren.htm

Thanks


Article Comments

Hello,

Thank you for your message.

To check how to execute a request in a specific language, I invite you to use the tool called Postman. You can find it right here: https://www.postman.com/

With Postman, when you have configured your HTTP request, you can export it in the programming language you desire, including C#:

var client = new RestClient("https://{PRTGServer}:{Port}/{Token}?value={Value}&text={Message}");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

Please replace tha variables between {} according to the configuration of your PRTG Server as well as HTTP Push Data sensor.

Kind regards.


Oct, 2020 - Permalink