简体   繁体   中英

Can't get a response back when using localhost on Asp.net web API and postman

I was attempting to run my asp.net web API project in debug mode and then call it from postman. I tried calling the default api values controller but my request keeps timing out saying it cant reach the server:

Values Controller:

public class ValuesController : ApiController
{
    // GET api/values
    public IEnumerable<string> Get()
    {
        return new string[] { "value1", "value2" };
    }

    // GET api/values/5
    public string Get(int id)
    {
        return "value";
    }

    // POST api/values
    public void Post([FromBody]string value)
    {
    }

    // PUT api/values/5
    public void Put(int id, [FromBody]string value)
    {
    }

    // DELETE api/values/5
    public void Delete(int id)
    {
    }
}

Postman response:

在此处输入图像描述

Web Browser Help Page:

在此处输入图像描述

Is there some additional setup I need to do? Or common issues related to this?

It will be fixed if you do the ssl certificate offline from Settings. 设置

SSL 证书验证:关闭

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM