[Solved] Encode arbitrary string to JSON in http response


Solution (w is the responseWriter)

str := "{\"key1\":{\"key2\":\"value1\",\"key3\":\"value2\"}}"
w.Write([]byte(str))

2

solved Encode arbitrary string to JSON in http response