picohttpparser #

fn cmp #

fn cmp(dst string, src string) bool

fn cmpn #

fn cmpn(dst string, src string, n int) bool

struct Request #

struct Request {
pub mut:
	method      string
	path        string
	headers     [100]C.phr_header
	num_headers u64
	body        string
}

fn (Request) parse_request #

fn (mut r Request) parse_request(s string, max_headers int) int

fn (Request) parse_request_path #

fn (mut r Request) parse_request_path(s string) int

fn (Request) parse_request_path_pipeline #

fn (mut r Request) parse_request_path_pipeline(s string) int

struct Response #

struct Response {
	fd int
pub:
	date      byteptr
	buf_start byteptr
pub mut:
	buf byteptr
}

fn (Response) http_ok #

fn (mut r Response) http_ok() &Response

fn (Response) header #

fn (mut r Response) header(k string, v string) &Response

fn (Response) header_date #

fn (mut r Response) header_date() &Response

fn (Response) header_server #

fn (mut r Response) header_server() &Response

fn (Response) content_type #

fn (mut r Response) content_type(s string) &Response

fn (Response) html #

fn (mut r Response) html() &Response

fn (Response) plain #

fn (mut r Response) plain() &Response

fn (Response) json #

fn (mut r Response) json() &Response

fn (Response) body #

fn (mut r Response) body(body string)

fn (Response) http_404 #

fn (mut r Response) http_404()

fn (Response) http_405 #

fn (mut r Response) http_405()

fn (Response) http_500 #

fn (mut r Response) http_500()

fn (Response) raw #

fn (mut r Response) raw(response string)

fn (Response) end #

fn (mut r Response) end() int