我有一个 Silverlight 4.0 应用程序,它使用客户端上的 RESTful 调用 MVC3 应用程序Hammock API
来发出 RESTful 服务代码。
问题是无论request.Method
设置为WebMethod.Get
还是WebMethod.Post
,发送的请求都是POST
. 我究竟做错了什么?
private IAsyncResult GetServerList()
{
var callback = new RestCallback((restRequest, restResponse, userState) =>
{
// There is some working callback code here. Excluded for clarity.
}
);
var request = new RestRequest();
request.Method = WebMethod.Get;
request.Path = "ServerList";
return _restClient.BeginRequest(request, callback);
}