HTML
Content-Type: "text/html"
The Context.HTML(format, ...args) is the method which sends HTML responses to the client. It accepts the value (like fmt package works).
1
func handler(ctx iris.Context) {
2
response := "Hello, <strong>%s!</strong>"
3
ctx.HTML(response, "World")
4
}
Copied!
Result
1
Hello, <strong>World!</strong>
Copied!
If you want to learn how to render template files or embedded views please head over to the View chapter instead.
Last modified 1yr ago
Export as PDF
Copy link