如何调用 URL 地址与基地址完全相同的端点?
string localhost = "http://localhost:1387";
ServiceHost restHost = new ServiceHost(typeof(WebService), new Uri(localhost));
restHost.AddServiceEndpoint(typeof(IWebService), new WebHttpBinding(), "").Behaviors.Add(new RestBehavior());
hosts.Add(restHost);
这是服务,我想用http://localhost:1387调用它
[WebInvoke(Method = "GET", UriTemplate = "", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped)]
public Stream GetBase()
{
//do action
}