response text
Gerasimos (Makis) Maropoulos edited this page Aug 7, 2020
·
1 revision
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.
Home | Project | Quick Start | Technical Docs | Copyright © 2019-2020 Gerasimos Maropoulos. Documentation terms of use.
Pages 72
- Home
- API versioning
- Automatic public address
- Benchmarks
- Cache
- Configuration
- Content negotiation
- Cookies
- dependency injection
- Documentation terms and conditions
- file server context file server
- file server introduction
- file server listing
- file server memory cache
- Forms
- Grpc
- Host
- HTTP method override
- HTTP referrer
- Installation
- Localization
- Model validation
- MVC
- mvc grpc
- mvc mvc
- mvc quickstart
- mvc sessions
- mvc websockets
- Our users
- Project and community
- Publications
- Quick start
- README
- Request authentication
- response binary
- response content negotiation
- response gzip
- response html
- response http2_push
- response json
- response jsonp
- response markdown
- response messagepack
- response outroduction
- response problem
- response protobuf
- Response recorder
- response recorder
- response sse
- response stream
- response text
- response xml
- response yaml
- Routing
- Routing context methods
- Routing error handlers
- Routing middleware
- Routing override context
- Routing path parameter types
- Routing reverse lookups
- Routing subdomains
- Routing wrap the router
- Sessions
- Sessions database
- Sessions flash messages
- Sitemap
- Starter kits
- Support
- Testing
- URL query parameters
- View
- Websockets
- What is Iris
- 📌Getting Started
- Host
- Configuration
- Routing
- HTTP Method Override
- API Versioning
- Content Negotiation
- Response Recorder
- HTTP Referrer
- Request Authentication
- URL Query Parameters
- Forms
- Model Validation
- Cache
- View
- Cookies
- Sessions
- Websockets
- Dependency Injection
- MVC
- gRPC
- Sitemap
- Localization
- Testing
- 🤓Resources