0
votes

I am using IActionResult in Web API Controller and heating method from Postman ,My Functionality is working but not getting success response . My Code is:

    [HttpPut]
    [Route ("MarkAsInActive")]
    public IActionResult MarkAsInActive (Pousada pousada)
    {
        try
        {
            var x =  Service.MarkAsInActive(pousada.ID, pousada.IsActive);

            if (x != null)
            {
                return Ok(x);
            }
            else
            {
                return BadRequest ();
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }

Response in Postman is: Could not get any response There was an error connecting to https://localhost:44303/api/Pousada/MarkAsInActive. Why this might have happened: The server couldn't send a response: Ensure that the backend is working properly Self-signed SSL certificates are being blocked: Fix this by turning off 'SSL certificate verification' in Settings > General Proxy configured incorrectly Ensure that proxy is configured correctly in Settings > Proxy Request timeout: Change request timeout in Settings > General

But I want Reponse in Json format as like: { "ID":"43956f24-ddcc-41b1-a29b-71f717c6fb0e", "IsActive":"true" }

2

2 Answers

0
votes

Basically, the error message is self-descriptive. Since I assume you don't want to have a headache installing the valid SSL certificate on your machine just disable certificate verification setting in your postman like described here

0
votes

You are trying to connect over "https". Is this correct? If yes, and you are using a self signed certificate. Try to turn off certificate verification in Postman over File->Settings(General Tab) enter image description here