Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- http://localhost:2597/api/DeliveryManager/Status?country=US&delivery_provider=Postmates&job_id=del_LRJbs4qNKRCqzk
- [HttpGet]
- [Route("api/DeliveryManager/Status")]
- public async Task<DeliveryManagerJobStatusResponse> GetDeliveryManagerStatus([FromUri]DeliveryManagerStatus status)
- {
- }
- public class DeliveryManagerStatus
- {
- public string Country { get; set; }
- public string DeliveryProvider { get; set; }
- public string JobId { get; set; }
- }
- [HttpGet]
- [Route("api/DeliveryManager/Status")]
- public async Task<DeliveryManagerJobStatusResponse> GetDeliveryManagerStatus(string country = "", string provider = "", string jobId = "")
- {
- }
- public static void Register(HttpConfiguration config)
- {
- // Web API configuration and services
- // Web API routes
- config.MapHttpAttributeRoutes();
- config.Routes.MapHttpRoute(
- name: "DefaultApi",
- routeTemplate: "api/{controller}/{type}",
- defaults: new { type = RouteParameter.Optional }
- );
- // I tried this too but not getting the desired result.
- config.Routes.MapHttpRoute(
- name: "StatusApi",
- routeTemplate: "api/{controller}/{type}/{country}/{deliveryProvider}/{jobId}"
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement