pekko/akka-docs-dev/rst/scala/http/routing-dsl/directives/host-directives/extractHost.rst
2015-05-21 17:34:46 +02:00

27 lines
No EOL
568 B
ReStructuredText

.. _-extractHost-:
extractHost
===========
Extracts the hostname part of the Host header value in the request.
Signature
---------
.. includecode2:: /../../akka-http-scala/src/main/scala/akka/http/scaladsl/server/directives/HostDirectives.scala
:snippet: extractHost
Description
-----------
Extract the hostname part of the ``Host`` request header and expose it as a ``String`` extraction
to its inner route.
Example
-------
.. includecode2:: ../../../../code/docs/http/scaladsl/server/directives/HostDirectivesExamplesSpec.scala
:snippet: extractHost