2015-05-11 23:05:18 +02:00
|
|
|
.. _-respondWithHeader-:
|
|
|
|
|
|
|
|
|
|
respondWithHeader
|
|
|
|
|
=================
|
|
|
|
|
|
|
|
|
|
Signature
|
|
|
|
|
---------
|
|
|
|
|
|
2015-06-19 15:35:24 +02:00
|
|
|
.. includecode2:: /../../akka-http/src/main/scala/akka/http/scaladsl/server/directives/RespondWithDirectives.scala
|
2015-05-11 23:05:18 +02:00
|
|
|
:snippet: respondWithHeader
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Description
|
|
|
|
|
-----------
|
2015-10-09 15:19:36 +02:00
|
|
|
Adds a given HTTP header to all responses coming back from its inner route.
|
2015-05-11 23:05:18 +02:00
|
|
|
|
|
|
|
|
This directive transforms ``HttpResponse`` and ``ChunkedResponseStart`` messages coming back from its inner route by
|
|
|
|
|
adding the given ``HttpHeader`` instance to the headers list.
|
|
|
|
|
|
2015-10-09 15:19:36 +02:00
|
|
|
See also :ref:`-respondWithHeaders-` if you'd like to add more than one header.
|
2015-05-11 23:05:18 +02:00
|
|
|
|
|
|
|
|
Example
|
|
|
|
|
-------
|
|
|
|
|
|
2015-09-16 23:50:35 +02:00
|
|
|
.. includecode2:: ../../../../code/docs/http/scaladsl/server/directives/RespondWithDirectivesExamplesSpec.scala
|
2015-10-01 13:25:41 +02:00
|
|
|
:snippet: respondWithHeader-0
|