using RestSharp; IRestClient client = new RestClient("https://example.com"); IRestRequest request = new RestRequest("/api/data", Method.GET); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content);
using RestSharp; IRestClient client = new RestClient("https://example.com"); IRestRequest request = new RestRequest("/api/data", Method.POST); request.AddParameter("param1", "value1"); request.AddParameter("param2", "value2"); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content);This code creates an IRestClient instance that points to "https://example.com" and sends a POST request to "/api/data" with two parameters - "param1" and "param2". The response is then printed to the console.