Advertisement
Guest User

Untitled

a guest
Apr 19th, 2014
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. [Route("api/formHTML/{id}/{code}/{value}")]
  2. public IEnumerable<string> Get(int id, int code, int value)
  3. {
  4. return new string[] {"<html><head></head><body>Test</body></html>"};
  5. }
  6.  
  7. protected void Application_Start(object sender, EventArgs e)
  8. {
  9. GlobalConfiguration.Configuration.Routes.MapHttpRoute(
  10. name: "DefaultApi",
  11. routeTemplate: "api/{controller}"
  12. );
  13. }
  14.  
  15. GlobalConfiguration.Configure(WebApiConfig.Register);
  16.  
  17. public class WebApiConfig
  18. {
  19. public static void Register(HttpConfiguration config)
  20. {
  21. config.MapHttpAttributeRoutes();
  22. config.Routes.MapHttpRoute(
  23. name: "DefaultApi",
  24. routeTemplate: "api/{controller}/{id}",
  25. defaults: new { id = System.Web.Http.RouteParameter.Optional }
  26. );
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement