GoldenCow
03/14/2022, 8:00 AMsuspend fun addShoppingListItem(shoppingListItem: ShoppingListItem) {
<http://jsonClient.post|jsonClient.post><Unit>(endpoint + ShoppingListItem.path) {
contentType(ContentType.Application.Json)
body = shoppingListItem
}
}
This is what the server does when it receives a POST request:
post {
collection.insertOne(call.receive<ShoppingListItem>())
call.respond(HttpStatusCode.OK)
}
but this is what I get every time I perform a POST request through my browser.
Are there any help or docs I might be able to benefit from?Rustam Siniukov
03/14/2022, 2:08 PMGoldenCow
03/15/2022, 2:23 AMheader(HttpHeaders.ContentType)
everything now works!