Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1b8b892
commit f3b3649
Showing
4 changed files
with
40 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package lens.example | ||
|
||
import com.twitter.finagle.http.{Method, Request} | ||
import io.fintrospect.ContentTypes | ||
import lens.Injector._ | ||
import lens.{Body, Header} | ||
|
||
object example extends App{ | ||
|
||
private val value = Body.string(ContentTypes.APPLICATION_ATOM_XML).toLens | ||
|
||
case class Bob(i: Int) | ||
|
||
val a = Header.int().map(Bob, (s: Bob) => s.i).required("booo") | ||
println(Request(Method.Get, "/asd").inject(a --> Bob(123), value --> "asdasd").headerMap) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters