Ktor: Get 415 Unsupported Media Type when calling call.receiveOrNull() with empty body

Created on 11 Jun 2018  路  2Comments  路  Source: ktorio/ktor

Calling call.receiveOrNull() on an empty request body got me a 415 Unsupported Media Type. Is receiveOrNull() not supposed to return null in case it cannot transform to the requested type ?

bug

Most helpful comment

For sure it's a design issue. For now the only workaround is to catch UnsupportedMediaTypeException

All 2 comments

For sure it's a design issue. For now the only workaround is to catch UnsupportedMediaTypeException

Fixed in 0.9.3

Was this page helpful?
0 / 5 - 0 ratings