vibe.d beta banner
get vibe.d
0.10.1

Asynchronous I/O that doesn’t get in your way, written in D

Variable HTTPServerRequest.context

A map of context items for the request.

class HTTPServerRequest
{
  // ...
  DictionaryList!(std.variant.VariantN!(32L).VariantN,true,2L,false) context ;
  // ...
}

This is especially useful for passing application specific data down the chain of processors along with the request itself.

For example, a generic route may be defined to check user login status, if the user is logged in, add a reference to user specific data to the context.

This is implemented with std.variant.Variant to allow any type of data.

Authors

Sönke Ludwig, Jan Krüger, Ilya Shipunov

Copyright

© 2012-2017 RejectedSoftware e.K.

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.