Skip to content

Commit

Permalink
Update withParsedInput to withParsedBody
Browse files Browse the repository at this point in the history
`withParsedInput` has been replaced with `withParsedBody`, but the
code examples hadn't been updated.
  • Loading branch information
samporapeli committed Jan 29, 2024
1 parent 2d7ef6e commit 48afa23
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 48afa23

Please sign in to comment.