Text
Content-Type: "text/plain"
The Context.Text(format, ...args) is the method which sends plain text responses to the client. It accepts the value (like fmt package works). It's identical to Context.WriteString and Context.Writef.
1
func handler(ctx iris.Context) {
2
response := "Hello, %s!"
3
ctx.Text(response, "World")
4
// ctx.Writef(response, "World")
5
}
Copied!
Result
1
Hello, World!
Copied!
That's all.
Last modified 1yr ago
Export as PDF
Copy link