# Respond with any content type

> Send a string or a Buffer with the content type you choose using $.content(value, type), for the formats that json(), plain() and html() do not cover.

Framework: total5
Product: Total.js 5 (total5@0.0.20)
Language: en
Content-SHA256: 42343c72c61e4effc7f19da75e75291b459eb702e3df31f7991681051dd0dd09
Snapshot: c0700e321579725c5cf4f5ace1ad7d2866d1b4f93c24a63c0b41b6b7998e976c
Sources: total5-installed@total5@0.0.19
Review: not-recorded

`$.json()`, `$.html()`, `$.plain()` and `$.xml()` each set their content type. For anything else, `0.0.20` adds `$.content(value, contentType)`: it sends `value` (a string or a Buffer) with the content type you pass, and `application/octet-stream` when you pass none. Use it for a CSV, an ICS calendar, a vCard, an RSS feed, a Markdown file, or bytes that you built in memory.

```js controllers/content.js
exports.install = function() {
	ROUTE('GET /report/', csv);
	ROUTE('GET /agenda/', ics);
	ROUTE('GET /bytes/', bytes);
};

function csv($) {
	$.content('id,name\n1,Ann\n2,Peter\n', 'text/csv');
}

function ics($) {
	$.content('BEGIN:VCALENDAR\nVERSION:2.0\nEND:VCALENDAR\n', 'text/calendar');
}

function bytes($) {
	$.content(Buffer.from([1, 2, 3]));
}
```

This only sets the content type and the body. For a download name or for a file on the disk use `$.file()`, `$.binary()` or `$.stream()`.
