Open aminghadersohi opened 4 years ago
@aminghadersohi We have one written internally. I'll work on getting it published as a library. It's so small that in the meantime I've put it into this gist if you want to copy it: https://gist.github.com/garyp/fe4dc73058f84245830fbae024d0ca6e.
Thanks so much!
Ok, That was because i was using okhttp 3 instead of 4.4.0
New error:
pbandk can't handle response body with content type application/x-protobuf
I added this:
private const val protobufxMediaType = "application/x-protobuf"
protobufMediaType, protobufxMediaType -> value.byteStream().use {
val value =
messageCompanion.protoUnmarshal(Unmarshaller(CodedInputStream.newInstance(it)))
if (BuildConfig.DEBUG) {
Log.d("ProtoConverter", value.toString())
}
value
}
Also I want to log the request and response body, so I use value.tostring() there.
Is it ok if i make it a library?
Is there a recommended Convertor for Retrofit for the generated Kotlin code?