use bytes.Buffer instead of strings/io.Reader and set content type to json