A simple way to stream JSON with Rails Live API

A few weeks ago I faced with a requirement to optimize a huge JSON response from Rails-based API. For example, we want to respond large set of data as JSON collection. In our controller, we have some action for that, but rails Live API couldn’t stream JSON or XML directly. But we can use a little trick. 1 2 3 4 5 6 7 class PostsController def index @data = Post....

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 1 implementation "com.fasterxml.jackson.module:jackson-module-kotlin" And the example code for POST json request. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 import com....