RestRequest request = new RestRequest("https://example.com/api", Method.GET); request.AddCookie("session_id", "12345");
var client = new RestClient("https://api.example.com/"); var request = new RestRequest("resource/{id}", Method.POST); request.AddUrlSegment("id", "123"); request.AddCookie("session_id", "12345");In this example, we are using the RestClient package library to send a POST request to the API endpoint "https://api.example.com/resource/123", adding a URL segment "id" with value "123", and adding a cookie with name "session_id" and value "12345" to the request header. The package library used in these examples is RestSharp, a popular package for sending and receiving RESTful web service calls.