vweb.json()
parent
74b3ef3a3f
commit
a6df3e51d2
|
@ -16,8 +16,14 @@ pub:
|
|||
headers []string
|
||||
}
|
||||
|
||||
pub fn (ctx Context) write(s string) {
|
||||
//ctx.conn.write(s)
|
||||
pub fn (ctx Context) json(s string) {
|
||||
h := ctx.headers.join('\n')
|
||||
ctx.conn.write('HTTP/1.1 200 OK
|
||||
Content-Type: application/json
|
||||
$h
|
||||
|
||||
$s
|
||||
')
|
||||
}
|
||||
|
||||
pub fn (ctx Context) redirect(url string) {
|
||||
|
|
Loading…
Reference in New Issue