response binary
Pages 72
- 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
Clone this wiki locally
Content-Type: "application/octet-stream"
A MIME attachment with the content type "application/octet-stream" is a binary file. Typically, it will be an application or a document that must be opened in an application, such as a spreadsheet or word processor. If the attachment has a filename extension associated with it, you may be able to tell what kind of file it is. A .exe extension, for example, indicates it is a Windows or DOS program (executable), while a file ending in .doc is probably meant to be opened in Microsoft Word.
No matter what kind of file it is, an application/octet-stream attachment is rarely viewable in web client. After downloading an attachment users must then open the attachment in the appropriate application to view its contents.
The Context.Binary(data) is the method which sends binary responses to the client. It accepts []byte value.
func handler(ctx iris.Context) {
ctx.Binary([]byte("Some binary data here."))
}You may also want to see the following methods for file serving.
Home | Project | Quick Start | Technical Docs | Copyright © 2019-2020 Gerasimos Maropoulos. Documentation terms of use.