# Using Retrofit and Alamofire with Kotlin Serialization on Kotlin Multiplatform

DevFeed: [Using Retrofit and Alamofire with Kotlin Serialization on Kotlin Multiplatform](<https://devfeed.tech/articles/using-retrofit-and-alamofire-with-kotlin-serialization-on-kotlin-multiplatform-25546.md>)

Original publisher: [Read original article](<https://www.marcogomiero.com/posts/2020/kotlin-serialization-alamofire/>)

Author: Marco Gomiero

Published: 2020-12-10T00:00:00Z

Content type: tutorial

Language: en

Sources: [Posts on Marco Gomiero](<https://devfeed.tech/sources/posts-on-marco-gomiero.md>)

Topics: [Kotlin Multiplatform](<https://devfeed.tech/topics/kotlin-multiplatform.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Mobile](<https://devfeed.tech/topics/mobile.md>), [Android](<https://devfeed.tech/topics/android.md>), [iOS](<https://devfeed.tech/topics/ios.md>), [Library](<https://devfeed.tech/topics/library.md>), [API](<https://devfeed.tech/topics/api.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [api](<https://devfeed.tech/tags/api.md>), [backend](<https://devfeed.tech/tags/backend.md>), [kmp](<https://devfeed.tech/tags/kmp.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-multiplatform](<https://devfeed.tech/tags/kotlin-multiplatform.md>), [kotlin-serialization](<https://devfeed.tech/tags/kotlin-serialization.md>), [ktor](<https://devfeed.tech/tags/ktor.md>), [library](<https://devfeed.tech/tags/library.md>), [mobile](<https://devfeed.tech/tags/mobile.md>), [network](<https://devfeed.tech/tags/network.md>), [rest](<https://devfeed.tech/tags/rest.md>), [retrofit](<https://devfeed.tech/tags/retrofit.md>), [serialization](<https://devfeed.tech/tags/serialization.md>), [swift](<https://devfeed.tech/tags/swift.md>)

## AI overview

This tutorial explains how to use Retrofit on Android and Alamofire on iOS in a Kotlin Multiplatform Mobile application while sharing DTO definitions and Kotlin Serialization-based deserialization across the KMP module and mobile clients.

## Source excerpt

If you are starting a project with Kotlin Multiplatform and you want to share the network layer, the best way to go is definitely with Ktor. But if you don't want to share the entire network layer but maybe only the DTOs? There could be many reasons for wanting this. Maybe you are starting to integrate Kotlin Multiplatform (I'll call it KMP in the rest of the article) into an existing project and the work for sharing the entire network layer is simply too much.