Hi friends
when I am trying with this format api not working.
Web Api development(.net core 2.MVC)
api/controller?parameter=
where as when I am giving / in place of question mark it is giving the json result.
api/controller/parameter=
please help me to fix the above issue.
Thanks in advance.
prasanna pPosted Dec 6, 2019, 8:43 PM
Jenith ThakkarPosted Dec 4, 2019, 5:42 AM
Ramachandran MPosted Dec 4, 2019, 5:26 AM
prasanna pPosted Dec 4, 2019, 5:02 AM
Ramachandran MPosted Dec 4, 2019, 4:03 AM
public HttpResponseMessage Get([FromUri] string id)
{
prasanna pPosted Dec 3, 2019, 6:15 AM
[Route("api/GetBooksByLocale/{lcid:int?}")]public HttpResponseMessage> GetBooksByLocale(int lcid = 1033)
but in my case it is a string field.But the above method call syntax is not there to string,where as other datatypes are there.
Is there any other way to resolve the issue with the same api?
how to get that with questionmark call after controller name like this
http://localhost:1201/api/Entity?keyword= --for optional
Ramachandran MPosted Dec 3, 2019, 6:06 AM
[Route("api/GetBooksByLocale/{lcid:int?}")] public HttpResponseMessage> GetBooksByLocale(int lcid = 1033)prasanna pPosted Dec 3, 2019, 5:26 AM
Jenith ThakkarPosted Dec 3, 2019, 5:08 AM
prasanna pPosted Dec 3, 2019, 4:46 AM
Jaimin ShethiyaPosted Dec 3, 2019, 4:30 AM
can you please try to below code.
http://localhost:1041/api/Entity/Get?keyword=A
And also check the below line if not added then please added.
[Route("api/[controller]")]
public class EntityController : ApiController
Thanks
prasanna pPosted Dec 3, 2019, 4:02 AM
{
//[Authorize]
public class EntityController : ApiController
{
{
try
{
Dictionary
Ramachandran MPosted Dec 3, 2019, 3:59 AM
ApiControllerJenith ThakkarPosted Dec 3, 2019, 3:58 AM
prasanna pPosted Dec 3, 2019, 3:46 AM
Jenith ThakkarPosted Dec 3, 2019, 3:36 AM
prasanna pPosted Dec 3, 2019, 3:22 AM
Ramachandran MPosted Dec 3, 2019, 2:57 AM
prasanna pPosted Dec 3, 2019, 2:03 AM
Ramachandran MPosted Dec 3, 2019, 1:49 AM