Designing a REST API can be a daunting task. There are many different ways to design an API and no one way is perfect. However, there are some best practices that can help you design a Kotlin REST API that is both effective and easy to use.
When designing your Kotlin REST API, there are a few things to keep in mind. First, you need to decide what data your API will return. This data can be in the form of JSON, XML, or any other format. Next, you need to decide what methods your API will support. The most common methods are GET, POST, PUT, and DELETE. Finally, you need to decide what URL structure your API will have.
When returning data from your Kotlin REST API, it is important to use the proper data format. JSON is the most common data format for REST APIs. It is human readable and easy to parse. XML is another popular data format, but it can be more difficult to parse. Choose the data format that is best for your application.
Your Kotlin REST API should support the most common HTTP methods: GET, POST, PUT, and DELETE. GET is used to retrieve data from the server. POST is used to create data on the server. PUT is used to update data on the server. DELETE is used to delete data on the server.
Your Kotlin REST API should have a well-defined URL structure. The most common URL structure is /{resource}/{id}. For example, /users/1 would retrieve the user with the ID of 1. /users would retrieve all users. /users/1/friends would retrieve all friends of the user with the ID of 1.
https://kotlinlang.org/docs/reference/http-clients.html
https://ktor.io/
https://javadoc.io/doc/com.github.kittinunf.fuel/fuel/latest/index.html