Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. http://localhost:2597/api/DeliveryManager/Status?country=US&delivery_provider=Postmates&job_id=del_LRJbs4qNKRCqzk
  2.  
  3. [HttpGet]
  4. [Route("api/DeliveryManager/Status")]
  5. public async Task<DeliveryManagerJobStatusResponse> GetDeliveryManagerStatus([FromUri]DeliveryManagerStatus status)
  6. {
  7. }
  8.  
  9. public class DeliveryManagerStatus
  10. {
  11. public string Country { get; set; }
  12. public string DeliveryProvider { get; set; }
  13. public string JobId { get; set; }
  14. }
  15.  
  16. [HttpGet]
  17. [Route("api/DeliveryManager/Status")]
  18. public async Task<DeliveryManagerJobStatusResponse> GetDeliveryManagerStatus(string country = "", string provider = "", string jobId = "")
  19. {
  20. }
  21.  
  22. public static void Register(HttpConfiguration config)
  23. {
  24. // Web API configuration and services
  25.  
  26. // Web API routes
  27. config.MapHttpAttributeRoutes();
  28.  
  29. config.Routes.MapHttpRoute(
  30. name: "DefaultApi",
  31. routeTemplate: "api/{controller}/{type}",
  32. defaults: new { type = RouteParameter.Optional }
  33. );
  34.  
  35. // I tried this too but not getting the desired result.
  36. config.Routes.MapHttpRoute(
  37. name: "StatusApi",
  38. routeTemplate: "api/{controller}/{type}/{country}/{deliveryProvider}/{jobId}"
  39. );
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement