title: How to set Content-Type header on Ring-Compojure application
body: <p>I'm trying to get started with Clojure and Clojurescript by implementing a simple web app. Things are going pretty good so far and reading from different tutorials I've come up with the code below:</p>
  
  <p>core.clj:</p>
  
  <pre><code>(ns myapp.core
  (:require [compojure.core :as compojure]
            [compojure.handler :as handler]
            [compojure.route :as route]
            [myapp.controller :as controller]))
  
  (compojure/defroutes app-routes
    (compojure/GET "/" [] controller/index)
    (route/resources "/public")
    (route/not-found "Not Found"))
  
  (def app
    (handler/site app-routes))
  </code></pre>
  
  <p>controller.clj:</p>
  
  <pre><code>(ns myapp.controller
    (:use ring.util.response)
    (:require [myapp.models :as model]
              [myapp.templates :as template]))
  
  (defn index
    "Index page handler"
    [req]
    (-&gt;&gt; (template/home-page (model/get-things)) response))
  </code></pre>
  
  <p>templates.clj:</p>
  
  <pre><code>(ns myapp.templates
    (:use net.cgrand.enlive-html)
    (:require [myapp.models :as model]))
  
  
  (deftemplate home-page "index.html" [things]
    [:li] (clone-for [thing things] (do-&gt;
                                     (set-attr 'data-id (:id thing))
                                     (content (:name thing)))))
  </code></pre>
  
  <p>The problem is I can't display non-ascii characters on the page and I don't know how to set HTTP headers on a page.</p>
  
  <p>I see solutions like this but I simply can't figure out where place them in my code:</p>
  
  <pre><code>(defn app [request]
    {:status 200
     :headers {"Content-Type" "text/plain"}
     :body "Hello World"})
  </code></pre>
  
  <p>P.S: Any suggestions about style and/or code organization are welcome.</p>