picoev: add html() content-type method

pull/5570/head
nyaascii 2020-06-29 20:25:16 +02:00 committed by GitHub
parent 77e56aa3f9
commit 3436ae99fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -46,6 +46,12 @@ pub fn (mut r Response) content_type(s string) &Response {
return r return r
} }
[inline]
pub fn (mut r Response) html() &Response {
r.buf += cpy_str(r.buf, "Content-Type: text/html\r\n")
return r
}
[inline] [inline]
pub fn (mut r Response) plain() &Response { pub fn (mut r Response) plain() &Response {
r.buf += cpy_str(r.buf, "Content-Type: text/plain\r\n") r.buf += cpy_str(r.buf, "Content-Type: text/plain\r\n")