http://blog.csdn.net/wulex/article/details/71545471

 

路由

public static void Register(HttpConfiguration config)
{

// Web API routes
config.MapHttpAttributeRoutes();

config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "dzopen/{controller}/{action}/{id}",
defaults: new { id = RouteParameter.Optional }
);

}

 

控制器  使用Get请求

 

 

[HttpGet]
public HttpResponseMessage querymemberbymobileno([FromUri] userinfo user)
{
// name = HttpUtility.UrlEncode(name);

string resp = "";
var resps = new HttpResponseMessage(HttpStatusCode.OK);
resps.Content = new StringContent(resp, Encoding.UTF8, "application/xml");
return resps;

}
[HttpGet]
public string Get(string id)
{
return "Value";
}

}

public class userinfo
{
public string shop_card_id{get;set;}
public string mobile_no{get;set;}
public string category{get;set;}
public string method{get;set;}
public string format{get;set;}
public string v{get;set;}
public string app_key{get;set;}
public string sign{get;set;}
public string timestamp{get;set;}
public string sign_method { get; set; }
}
}

 

相关文章:

  • 2021-09-26
  • 2022-12-23
  • 2021-05-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-31
猜你喜欢
  • 2022-12-23
  • 2021-06-24
  • 2022-12-23
  • 2021-07-21
  • 2021-06-09
  • 2022-12-23
相关资源
相似解决方案