2015-05-11 23:05:18 +02:00
|
|
|
.. _-optionalHeaderValuePF-:
|
|
|
|
|
|
|
|
|
|
optionalHeaderValuePF
|
|
|
|
|
=====================
|
|
|
|
|
|
|
|
|
|
Calls the specified partial function with the first request header the function is ``isDefinedAt`` and extracts the
|
|
|
|
|
result of calling the function.
|
|
|
|
|
|
|
|
|
|
Signature
|
|
|
|
|
---------
|
|
|
|
|
|
2015-06-19 15:35:24 +02:00
|
|
|
.. includecode2:: /../../akka-http/src/main/scala/akka/http/scaladsl/server/directives/HeaderDirectives.scala
|
2015-05-11 23:05:18 +02:00
|
|
|
:snippet: optionalHeaderValuePF
|
|
|
|
|
|
|
|
|
|
Description
|
|
|
|
|
-----------
|
|
|
|
|
|
|
|
|
|
The ``optionalHeaderValuePF`` directive is similar to the ``headerValuePF`` directive but always extracts an ``Option``
|
|
|
|
|
value instead of rejecting the request if no matching header could be found.
|