Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Web API end point not working from postman but from swagger

I am working on WebAPI .Net Core 2.2, I have successfully added swagger and from swagger UI I am able to create POST or GET request. But when I execute endpoint from Postman nothing happened. Even break point hit on endpoint but proper result is not shown on postman UI

[HttpPost]
[Route("Details/{year:int}/Directors")]
public ActionResult DirectoryMoviesByYear(int year) 
{
     //sample code 
     return Ok(new Director { Id=1, Name="Peter Jackson" });

}

end point used in Postman https://localhost:44386/api/Movie/Details/1980/Directors

here is swagger screen shot result from swagger here is postman screen shot enter image description here

like image 943
zeeshan Avatar asked Mar 26 '19 13:03

zeeshan


2 Answers

Looks like you are using self-signed certificate for https and Postman just blocks request because of it. Configure Postman to not verify SSL cetrificates in File -> Settings

enter image description here

like image 192
Alexander Avatar answered Oct 22 '22 00:10

Alexander


Make Sure You OFF SSL certificate validation From Postman -> Preferences -> General -> SSL certificate validation -> OFF

and it's Working for me

like image 43
shafaetjsr Avatar answered Oct 22 '22 00:10

shafaetjsr