hi, is there any content length limit in ktor Andr...
# ktor
a
hi, is there any content length limit in ktor Android? I'm getting the content length of size 5632 characters in response but Ktor is returning the response of length 4055 Can anyone suggest something please?
a
hi, is there any content length limit in ktor Android?
There is no such limit. Can you share the code snippet where you check the response body size?
a
Well, I'm using ktor client logging and checking the size of the encrypted string from logs which is 4055
@Aleksei Tirman [JB]
a
Can you share the code snippet?
a
found that this is not ktor response issue But serialization problem Can you suggest how to serialize the class if it has Any type? receiving error on Any: Serializer has not been found for type 'Any'. To use context serializer as fallback, explicitly annotate type or property with @Contextua
Copy code
@Serializable
data class NetworkResponse(
    @SerialName("statusCode")
    val statusCode: String? = null,

    @SerialName("statusMessage")
    val statusMessage: String? = null,

    @SerialName("token")
    val token: String? = null,

    @SerialName("verification_token")
    val verificationToken: String? = null,

    @SerialName("data")
    val data: LinkedHashMap<String, Any>? = null,
)
a
I suggest looking into the contextual serializers.
a
thank you for the response Can you share the link for example, using gson with ktor?
a
So are you using Gson or kotlinx.serialization library?
a
Currently using kotlinx.serialization Now want to use Gson, as serialization require additional setup
a
Here, you find serialization examples including the Gson usage.
a
Thank you for the quick response!