WebApiConfig.cs 778 B

1234567891011121314151617181920212223242526
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web.Http;
  5. namespace AipGateway.Web
  6. {
  7. public static class WebApiConfig
  8. {
  9. public static void Register(HttpConfiguration config)
  10. {
  11. // Web API 구성 및 서비스
  12. config.Formatters.XmlFormatter.SupportedMediaTypes.Remove(
  13. config.Formatters.XmlFormatter.SupportedMediaTypes.FirstOrDefault(t => t.MediaType == "application/xml"));
  14. // Web API 경로
  15. config.MapHttpAttributeRoutes();
  16. config.Routes.MapHttpRoute(
  17. name: "DefaultApi",
  18. routeTemplate: "v1/{controller}/{id}",
  19. defaults: new { id = RouteParameter.Optional }
  20. );
  21. }
  22. }
  23. }