Discuss: change to Redirect?
Closed this issue · 4 comments
ThatRendle commented
At the moment, there's the IMayRedirect interface, which adds a Location property.
As an alternative, how about an extra Location property on Status which can only be set via static methods for each of the Redirect status values.
So instead of
public class ... : IPost, IMayRedirect
{
public Status Post()
{
...
Location = "/whatever";
return Status.SeeOther;
}
public string Location { get; private set; }
}
You'd have
public class ... : IPost
{
public Status Post()
{
...
return Status.SeeOther("/whatever");
}
}
Unless anyone has any objections, this is going to happen.
richardhopton commented
You should be able to do this with Created status as well
ToJans commented
Would be better IMO, as for now most of your interfaces are about requests, not about responses...
ThatRendle commented
@richardhopton And Accepted, possibly, looks like that should return a URI for checking on status.
ThatRendle commented
Also done.