api
writer.ch
Declarations in writer.ch
1 declarationshttp
Declarations
Public only
http#
Publicnamespace
namespace http
===== HTTP ResponseWriter =====
ResponseWriter#
Publicstruct
struct ResponseWriter {
var sock : Socket
var headers : HeaderMap
var status : uint
var sent_headers : bool
var is_head : bool
var tls_ctx : *SSLContext
}
constructor#
PublicfunctionConstructor
TLS context for secure writes (null = plain socket)
set_header#
Publicfunction
set_header_view#
Publicfunction
set_cors#
Publicfunction
send_data#
Publicfunction
func send_data(self : &ResponseWriter, data : *char, len : int) : void
send_headers#
Publicfunction
write_string#
Publicfunction
write_view#
Publicfunction
send_file#
Publicfunction
func send_file(self : &ResponseWriter, path_view : &string_view, content_type : &string_view) : bool
send_json#
Publicfunction
Send a JSON response. Sets Content-Type and serializes the value.
finish#
Publicfunction
func finish(self : &ResponseWriter) : void
delete#
function
func delete(self : *ResponseWriter) : void