杨华杰

Code 1

val response = Unirest.get("http://localhost:8080/person").asObject(Array<Person>::class.java)
println(response.status)
response.body.forEach { println(it) }

Code 2

val response = Unirest.get("http://localhost:8080/person").asObject(object : GenericType<List<Person>>(){})
println(response.status)
response.body.forEach { println(it) }

Controller sample

@RestController
@RequestMapping("/person")
class PersonController {
@GetMapping
fun list() = listOf(Person(1, "jie jie"), Person(2, "huihui"))
}

data class Person(val id: Int, val name…

--

--

Most times you need to setup http / https proxy in enterprise network, it gets annoying when you need to ignore these proxies for your internal applications.

Use following to ignore it

no_proxy=.yourcompany.com,.internal-nexus.com

ignore it temporarily in powershell

$env:no_proxy='.yourcompany.com,.internal-nexus.com'

--

--

Just found this shortcut and I think it’s good to share it. I suspected it will work in the other linux distribution.

TO quickly switch between chrome tabs,

Ctrl + Home go to previous tab

Ctrl + End go to next tab

this works in firefox as well.

--

--

Webcomponent is cool to build reusable custom elements without any existing UI framework.

However when your application grows, one page could load 100 to 1k http request to load these tiny javascript and css files.

Webpack seems complex, it bundles everything to a single JS/css file, can makes initial faster…

--

--