2015-05-11 23:05:18 +02:00
|
|
|
.. _-respondWithHeaders-:
|
|
|
|
|
|
|
|
|
|
respondWithHeaders
|
|
|
|
|
==================
|
|
|
|
|
|
|
|
|
|
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: respondWithHeaders
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Description
|
|
|
|
|
-----------
|
2015-10-09 15:19:36 +02:00
|
|
|
Adds the given HTTP headers 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`` instances to the headers list.
|
2015-10-09 15:19:36 +02:00
|
|
|
|
|
|
|
|
See also :ref:`-respondWithHeader-` if you'd like to add just a single 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: respondWithHeaders-0
|