Skip to content

Commit

Permalink
Merge pull request #26 from samporapeli/fix-with-parsed-input
Browse files Browse the repository at this point in the history
Update `withParsedInput` to `withParsedBody`
  • Loading branch information
sksamuel authored Mar 10, 2024
2 parents 2d7ef6e + 48afa23 commit c19f0a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ handler is used (returns 400 Bad Request with a JSON body of errors).
```kotlin
routing {
post("/isbn") {
withParsedInput(isbnParser) { isbn ->
withParsedBody(isbnParser) { isbn ->
println("Parsed ISBN $isbn")
call.respond(HttpStatusCode.Created)
}
Expand All @@ -295,7 +295,7 @@ Handlers can be composed together using the `compose` extension function on a ha
Eg, to use the logging handler with the json handler, we can do:

```kotlin
withParsedInput(parser, loggingHandler.compose(jsonHandler)) { parsed ->
withParsedBody(parser, loggingHandler.compose(jsonHandler)) { parsed ->
println("Parsed input $parsed")
call.respond(HttpStatusCode.OK)
}
Expand Down

0 comments on commit c19f0a6

Please sign in to comment.