I am running a simple API with Get, but I get constant, unlimited stream from Fiddler, now reaching into the thousands, after I launch the app through the "Run on Google Chrome" button (see first column of screenshot below):
Getting hammered with result 201.
The code below works as expected. This is my call (defaults to Get): http://localhost:50015/api/Values My result is correct; it returns a list of strings in browser.
This makes it impossible to follow the tutorial.
Its an awesome tutorial...but I am stuck on this step. I am sharing the link to that: https://www.youtube.com/watch?v=GbKBcDX8DDQ&list=PL6n9fhu94yhW7yoUOGNOfHurUE6bpOO2b&index=3
This is my code from the Values controller:
public class ValuesController : ApiController
{
static List<string> strings = new List<String>()
{
"value0","value1","value2"
};
// GET api/values
public IEnumerable<string> Get()
{
return strings; ;
}
// GET api/values/5
public string Get(int id)
{
return strings[id];
}
// POST api/values
public void Post([FromBody]string value)
{
strings.Add(value);
}
// PUT api/values/5
public void Put(int id, [FromBody]string value)
{
strings[id] = value;
}
// DELETE api/values/5
public void Delete(int id)
{
strings.RemoveAt(id);
}
}