pekko/akka-docs/rst/java/http/routing-dsl/directives/cookie-directives/optionalCookie.rst

16 lines
384 B
ReStructuredText

.. _-optionalCookie-java-:
optionalCookie
==============
Description
-----------
Extracts an optional cookie with a given name from a request.
Use the :ref:`-cookie-java-` directive instead if the inner route does not handle a missing cookie.
Example
-------
.. includecode:: ../../../../code/docs/http/javadsl/server/directives/CookieDirectivesExamplesTest.java#optionalCookie