POST request to API with Kotlin and Spring RestClient (RestTemplate)
I am new in Kotlin. So maybe this post is just a bookmark for future. For example we want request some API for some data by POST to it an json array of ids from our Spring service. First of all we need Jackson to parse API’s response. So check out your build.gradle file implementation "com.fasterxml.jackson.module:jackson-module-kotlin" And the example code for POST json request. import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper import com.fasterxml.jackson.module.kotlin.readValue import org.springframework.http.HttpEntity import org....