Right now, redirect always issues a 302. This means that the redirect will use the same method. This becomes a problem in a common case of needing to redirect on a DELETE action.
it will redirect to DELETE /contacts which is not what I would want. I can easily fix this browser behavior by changing the status to 303, which will cause the next call to be a GET. However, there is no way to to change this status in Scotty.
We could handle this in one of two ways:
Have redirect respect the the status set by a previous status call.
Create a redirectStatus that also takes a status and URL parameter.
Right now,
redirect
always issues a 302. This means that the redirect will use the same method. This becomes a problem in a common case of needing to redirect on aDELETE
action.For example, if I have:
it will redirect to
DELETE /contacts
which is not what I would want. I can easily fix this browser behavior by changing the status to 303, which will cause the next call to be aGET
. However, there is no way to to change this status in Scotty.We could handle this in one of two ways:
redirect
respect the the status set by a previousstatus
call.redirectStatus
that also takes a status and URL parameter.