var client = new RestClient("https://api.example.com"); var request = new RestRequest("/users/123", Method.DELETE); var response = await client.DeleteAsync(request);
var client = new RestClient("https://api.example.com"); var request = new RestRequest("/users/{id}", Method.DELETE); request.AddUrlSegment("id", "123"); var response = await client.DeleteAsync(request);In this example, we are passing a parameter to the DELETE request by adding it as a URL segment using the AddUrlSegment method. The {id} placeholder in the resource path is replaced with the value "123" before the request is sent. Overall, the IRestClient DeleteAsync method is a powerful tool for making DELETE requests to web APIs in C# projects using the RestSharp package library.