Skip to content

Latest commit

 

History

History
23 lines (16 loc) · 469 Bytes

File metadata and controls

23 lines (16 loc) · 469 Bytes

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.

func handler(ctx iris.Context) {
    response := "Hello, %s!"
    ctx.Text(response, "World")
    // ctx.Writef(response, "World")
}

Result

Hello, World!

That's all.