在the getting started of maingun API C#的标签,我发现下面的代码。RestRequest类在哪里?
public static RestResponse SendSimpleMessage() {
RestClient client = new RestClient();
client.BaseUrl = "https://api.mailgun.net/v2";
client.Authenticator =
new HttpBasicAuthenticator("api",
"key-3ax6xnjp29jd6fds4gc373sgvjxteol0");
RestRequest request = new RestRequest();
request.AddParameter("domain",
"samples.mailgun.org", ParameterType.UrlSegment);
request.Resource = "{domain}/messages";
request.AddParameter("from", "Excited User <[email protected]>");
request.AddParameter("to", "[email protected]");
request.AddParameter("to", "[email protected]");
request.AddParameter("subject", "Hello");
request.AddParameter("text", "Testing some Mailgun awesomness!");
request.Method = Method.POST;
return client.Execute(request);
}
当我谷歌的类的名称,我发现在不同的上下文中这个类的几个引用。不过,我似乎无法找到RestRequest类的完全限定名mailgun网站上的任何地方,谷歌或MSDN找到它的文档。
任何人都可以指出的是定义这个类在哪里?
您需要此库:http://restsharp.org/ – MUG4N
不知道为什么Mailgun不会将其添加到自己的文档中。 –