28 lines
805 B
ReStructuredText
28 lines
805 B
ReStructuredText
|
|
.. _-mapResponse-:
|
||
|
|
|
||
|
|
mapResponse
|
||
|
|
===========
|
||
|
|
|
||
|
|
Changes the response that was generated by the inner route.
|
||
|
|
|
||
|
|
Signature
|
||
|
|
---------
|
||
|
|
|
||
|
|
.. includecode2:: /../../akka-http-scala/src/main/scala/akka/http/scaladsl/server/directives/BasicDirectives.scala
|
||
|
|
:snippet: mapResponse
|
||
|
|
|
||
|
|
Description
|
||
|
|
-----------
|
||
|
|
|
||
|
|
The ``mapResponse`` directive is used as a building block for :ref:`Custom Directives` to transform a response that
|
||
|
|
was generated by the inner route. This directive transforms complete responses.
|
||
|
|
|
||
|
|
See also :ref:`-mapResponseHeaders-` or :ref:`-mapResponseEntity-` for more specialized variants and
|
||
|
|
:ref:`Response Transforming Directives` for similar directives.
|
||
|
|
|
||
|
|
Example
|
||
|
|
-------
|
||
|
|
|
||
|
|
.. includecode2:: ../../../../code/docs/http/scaladsl/server/directives/BasicDirectivesExamplesSpec.scala
|
||
|
|
:snippet: 0mapResponse
|