2015-05-11 23:05:18 +02:00
|
|
|
.. _-extractRequestContext-:
|
|
|
|
|
|
|
|
|
|
extractRequestContext
|
|
|
|
|
=====================
|
|
|
|
|
|
|
|
|
|
Signature
|
|
|
|
|
---------
|
|
|
|
|
|
2015-06-19 15:35:24 +02:00
|
|
|
.. includecode2:: /../../akka-http/src/main/scala/akka/http/scaladsl/server/directives/BasicDirectives.scala
|
2015-05-11 23:05:18 +02:00
|
|
|
:snippet: extractRequestContext
|
|
|
|
|
|
|
|
|
|
Description
|
|
|
|
|
-----------
|
|
|
|
|
|
2015-10-09 15:19:36 +02:00
|
|
|
Extracts the request's underlying :class:`RequestContext`.
|
|
|
|
|
|
|
|
|
|
This directive is used as a building block for most of the other directives,
|
|
|
|
|
which extract the context and by inspecting some of it's values can decide
|
|
|
|
|
what to do with the request - for example provide a value, or reject the request.
|
|
|
|
|
|
|
|
|
|
See also :ref:`-extractRequest-` if only interested in the :class:`HttpRequest` instance itself.
|
2015-05-11 23:05:18 +02:00
|
|
|
|
|
|
|
|
Example
|
|
|
|
|
-------
|
|
|
|
|
|
2015-09-16 23:50:35 +02:00
|
|
|
.. includecode2:: ../../../../code/docs/http/scaladsl/server/directives/BasicDirectivesExamplesSpec.scala
|
2015-10-09 15:19:36 +02:00
|
|
|
:snippet: extractRequestContext-example
|