Request

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

void handler(Request request, Output output)
{
   info("You asked for ", request.uri, " with method ", request.method, " and params ", request.get.data);
}

Members

Enums

Method
enum Method

HTTP methods

ParsingStatus
enum ParsingStatus
Undocumented in source.

Functions

dump
string dump(bool html)
toString
string toString()

Print request data

Manifest constants

buildId
enum buildId;

Every time you compile the app this value will change

Properties

body
auto body [@property getter]

Raw posted data

cookie
auto cookie [@property getter]

Cookies received from user

form
auto form [@property getter]

The fields from a form. Only if content-type is "multipart/form-data".

get
auto get [@property getter]

Params from query string

header
auto header [@property getter]

Http headers, always lowercase

host
auto host [@property getter]

The host that received the request

method
Method method [@property getter]

HTTP method

password
auto password [@property getter]

Basic http authentication password. Safe only if sent thru https!

post
auto post [@property getter]

Params from post if content-type is "application/x-www-form-urlencoded"

requestLine
auto requestLine [@property getter]

Use at your own risk! Raw data from user.

route
auto route [@property getter]

The sequence of endpoints called so far

uri
const(string) uri [@property getter]

The uri requested by user

user
auto user [@property getter]

Basic http authentication user. Safe only if sent thru https!

worker
auto worker [@property getter]

Which worker is processing this request?

Static functions

simpleNotSecureCompileTimeHash
string simpleNotSecureCompileTimeHash(string seed)
Undocumented in source. Be warned that the author may not have intended to support it.

Structs

FormData
struct FormData

Data sent through multipart/form-data.

RequestImpl
struct RequestImpl
Undocumented in source.
SafeAccess
struct SafeAccess(T)

Simple structure to safely access data from an associative array.

Variables

_internal
RequestImpl* _internal;
Undocumented in source.

Meta