aboutsummaryrefslogtreecommitdiffstats
path: root/include/crow/http_response.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/crow/http_response.h')
-rw-r--r--include/crow/http_response.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/crow/http_response.h b/include/crow/http_response.h
index f5e03b4..7940174 100644
--- a/include/crow/http_response.h
+++ b/include/crow/http_response.h
@@ -86,6 +86,12 @@ namespace crow
completed_ = false;
}
+ void redirect(const std::string& location)
+ {
+ code = 301;
+ set_header("Location", location);
+ }
+
void write(const std::string& body_part)
{
body += body_part;