您好我正在使用RestSharp nuget包中的RestClient,但我发现它没有实现IDisposable。所以我需要处理它或如何处置它?
示例代码来自Mailgun api:
RestClient client = new RestClient ();
client.BaseUrl = new Uri ("https://api.mailgun.net/v3");
client.Authenticator =
new HttpBasicAuthenticator ("api",
"YOUR_API_KEY");
RestRequest request = new RestRequest ();
request.AddParameter ("domain", "YOUR_DOMAIN_NAME", ParameterType.UrlSegment);
request.Resource = "{domain}/messages.mime";
request.AddParameter ("to", "bar@example.com");
request.AddFile ("message", Path.Combine ("files", "message.mime"));
request.Method = Method.POST;
return client.Execute (request);