I'm learning and creating sample WebApi. In Web Api project, controller name is Producer
. I am trying to get the firstname using postman but not getting any result.
I have followed this Multiple optional parameters web api attribute routing but not getting result.
From postman I am passing request as follows.
http://localhost:62116/api/Producer/GetUserAgencyDetails/?firstname=peter
Web Api header is as below.
[HttpGet]
[Route("GetUserAgencyDetails/{firstName}/{lastName}/{agencyName}/{emailAddress}/{userId}")]
public async Task<User> GetUserAgencyDetails(string firstName = "", string lastName = "", string agencyName = "", string emailAddress = "", string userId ="")
{
//some code
}
Please let me know what mistake I am doing.