diff --git a/Creating HTTP APIs with Ktor/03_customer-routes.md b/Creating HTTP APIs with Ktor/03_customer-routes.md index 43a38c0..4e9e5ab 100644 --- a/Creating HTTP APIs with Ktor/03_customer-routes.md +++ b/Creating HTTP APIs with Ktor/03_customer-routes.md @@ -132,11 +132,11 @@ Next, we implement the option for a client to `POST` a JSON representation of a post { val customer = call.receive() customerStorage.add(customer) - call.respondText("Customer stored correctly", status = HttpStatusCode.Accepted) + call.respondText("Customer stored correctly", status = HttpStatusCode.Created) } ``` -`call.receive` integrates with the Content Negotiation feature we configured one of the previous sections. Calling it with the generic parameter `Customer` automatically deserializes the JSON request body into a Kotlin `Customer` object. We can then add the customer to our storage and respond with a status code of 201 "Accepted". +`call.receive` integrates with the Content Negotiation feature we configured one of the previous sections. Calling it with the generic parameter `Customer` automatically deserializes the JSON request body into a Kotlin `Customer` object. We can then add the customer to our storage and respond with a status code of 201 "Created". At this point, it is worth highlighting again that in this tutorial, we are also intentionally glancing over issues that could arise from e.g. multiple requests accessing the storage at the same time. In production, data structures and code that can be accessed from multiple requests / threads at the same time should account for these cases – something that is out of the scope of this hands-on.