I am working with KMM & KTOR to post data to an API. However , when the post request is successful, it returns a set of API-specific headers. I am supposed to use one of the header information to make another request. So , I made the POST request to return an HttpResponse. However, AS shows this error when trying to make the post request in my main activity in android studio. Please any idea on how I can fix it? Thank you
Update: So I tried to access the http response from shared module instead and the error is gone.
There’s a new error though. I tried running the app and it says serializer for my model classes isn’t found. But I installed the serialization dependencies and included the necessary annotations
1 year ago
@Rita Okonkwo Show the code, where you get the serializer error, someone will figure it out : )
The thing is that you can’t import this HttpResponse in AS. You can handle it in the common module.
On thing that is really cool is to handle it using the “Railway System” (which is basically an Either approach) or an “Either” approach in the common module.