From c1da6c2b7510708294e58b550a451c57a4c022e8 Mon Sep 17 00:00:00 2001 From: Vladimir Kostyukov Date: Tue, 29 Jul 2014 18:48:17 +0700 Subject: [PATCH] Update Readme --- README.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index dec599ef1..1157fccbb 100644 --- a/README.md +++ b/README.md @@ -418,6 +418,18 @@ val a = JsonArray(JsonObject.empty, JsonObject.empty) val aa = aa.within { _.take(5).distinct } ``` +**Converting JSON into HTTP** +There is a magic service `io.finch.json.TurnJsonIntoHttp` that takes `JsonResponse` and converts it into an `HttpResponse`. + +```scala +import io.finch.json._ + +val a: Service[HttpRequest, JsonResponse] = ??? +val b: Service[HttpRequest, HttpResponse] = a ! TurnJsonIntoHttp +``` + +This also may be used with `Endpoint`. + Authorization with OAuth2 ------------------------- @@ -427,7 +439,7 @@ Basic HTTP Auth --------------- [Basic HTTP Auth](http://en.wikipedia.org/wiki/Basic_access_authentication) is supported out-of-the-box and implemented -as `finch.io.filter.BasicallyAuthorize` filter. +as `finch.io.auth.BasicallyAuthorize` filter. ```scala object ProtectedEndpoint extends Endpoint[HttpRequest, HttpResponse] { @@ -435,7 +447,6 @@ object ProtectedEndpoint extends Endpoint[HttpRequest, HttpResponse] { case Method.Get -> Root / "users" => BasicallyAuthorize("user", "password") ! GetUsers } } - ``` Licensing