Silverlight 如何使吊床问题成为HTTP GET
我有一个Silverlight 4.0应用程序,它使用客户机上的Silverlight 如何使吊床问题成为HTTP GET,silverlight,web-services,rest,silverlight-4.0,hammock,Silverlight,Web Services,Rest,Silverlight 4.0,Hammock,我有一个Silverlight 4.0应用程序,它使用客户机上的hammockAPI对MVC3应用程序进行RESTful调用,以发出RESTful服务代码 问题在于,无论请求.Method设置为WebMethod.Get还是WebMethod.Post,发送的请求都是Post。我做错了什么 private IAsyncResult GetServerList() { var callback = new RestCallback((restRequest, restResponse, u
hammockAPI
对MVC3应用程序进行RESTful调用,以发出RESTful服务代码
问题在于,无论请求.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);
}
尝试在RestClient上设置请求类型
var restClient = new RestClient
{
Method = WebMethod.Get
};
或者从你的例子:
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.Path = "ServerList";
_restClient.Method = WebMethod.Get;
return _restClient.BeginRequest(request, callback);
}
什么是重新请求?这是您编写的代码还是某个第三方组件的一部分?RestRequest是Hammock API库的一部分