Struct Request

A request from user. Do not store ref to this struct anywhere.

struct Request ;
void handler(Request request, Output output)
   info("You asked for ", request.path, " with method ", request.method, " and params ",;


body[get] std.typecons.Tuple!(const(char)[],"data",string,"contentType")Raw posted data
cookie[get] Request.SafeAccess!(string)Cookies received from user
form[get] Request.SafeAccess!(serverino.interfaces.Request.FormData)The fields from a form. Only if content-type is "multipart/form-data".
get[get] Request.SafeAccess!(string)Params from query string
header[get] Request.SafeAccess!(string)Http headers, always lowercase
host[get] const(string)The host that received the request
id[get] stringThe request ID. It is unique for each request.
method[get] Request.MethodHTTP method
password[get] const(string)Basic http authentication password. Safe only if sent thru https!
path[get] const(string)The path requested by user
post[get] Request.SafeAccess!(string)Params from post if content-type is "application/x-www-form-urlencoded"
requestLine[get] const(string)Use at your own risk! Raw data from user.
route[get] const(string[])The sequence of endpoints called so far
user[get] const(string)Basic http authentication user. Safe only if sent thru https!
worker[get] const(string)Which worker is processing this request?


dump (html) Print request data
toString () Print request data

Inner structs

FormData Data sent through multipart/form-data.
SafeAccess Simple structure to safely access data from an associative array.


Method HTTP methods