Update response method for redirect.

Close #1797