Closed dotnetchris closed 12 years ago
I tried to reproduce the trouble but nothing happened, in the actual restifulie web project I tried
private static int _total;
public virtual ActionResult Get(int id)
{
var item = database.List().SingleOrDefault(i => i.Id == id);
if (item == null) return new NotFound();
if (id == 3)
{
if (_total++ % 2 != 0)
return new NotModified();
}
return new OK(item);
}
I requested it via jQuery
$.get("http://localhost:1198/Items/Get/3")
But nothing happened, the server has not tried to respond with View
I could never reproduce this outside of my solution, so I'm just going to close this for now unless I come up with anything new.
I'm not sure if this is some kind of compound issue as I couldn't seem to reproduce this directly in the sample Web.csproj on restfulie.
I'm having an issue where I respond to a regular browser request after checking the Request.Headers["If-Modified-Since"] with a new NotModified() restfulie result. Instead of it returning to the browser immediately, it actually tries to respond with the view which then blows up spectacularly because the model is null.
As a temporary work around I had to create this class:
And respond with this instead of the restfulie result.