javascript anonymous object in kotlin

前端 未结 6 2054
终归单人心
终归单人心 2021-02-07 09:18

how to create JavaScript anonymous object in kotlin? i want to create exactly this object to be passed to nodejs app

var header = {“content-type”:”text/plain” ,          


        
6条回答
  •  长发绾君心
    2021-02-07 09:23

    One more possible solution:

    object {
            val `content-type` = "text/plain"
            val `content-length` = 50
    }
    

    It seems that it does not work anymore with escaped variable names.

提交回复
热议问题