Convenient extractor allowing to apply two extractors.
Convenient extractor allowing to apply two extractors. Example of use:
request match { case Accepts.Json() & Accepts.Html() => "This request accepts both JSON and HTML" }
Common extractors to check if a request accepts JSON, Html, etc.
Common extractors to check if a request accepts JSON, Html, etc. Example of use:
request match { case Accepts.Json() => Ok(toJson(value)) case _ => Ok(views.html.show(value)) }