title: How can I explicitly set content type on compojure response?
body: <p>I am playing with compojure-api and am blocked at trying to manage Content-Type for my simple webapp.  What I want is to emit an HTTP response that is just plain/text, but somehow Compojure-API keeps setting it to "application/json".</p>
  
  <pre><code>    (POST "/echo" []
        :new-relic-name "/v1/echo"
        :summary "info log the input message and echo it back"
        :description nil
        :return String
        :form-params [message :- String]
        (log/infof "/v1/echo message: %s" message)
        (let [resp (-&gt; (resp/response message)
                       (resp/status 200)
                       (resp/header "Content-Type" "text/plain"))]
          (log/infof "response is %s" resp)
          resp))
  </code></pre>
  
  <p>but curl shows the server responded Content-Type:application/json.</p>
  
  <pre><code>$ curl -X POST -i --header 'Content-Type: application/x-www-form-urlencoded' -d 'message=frickin compojure-api' 'http://localhost:8080/v1/echo'
  HTTP/1.1 200 OK
  Date: Fri, 13 Jan 2017 02:04:47 GMT
  Content-Type: application/json; charset=utf-8
  x-http-request-id: 669dee08-0c92-4fb4-867f-67ff08d7b72f
  x-http-caller-id: UNKNOWN_CALLER
  Content-Length: 23
  Server: Jetty(9.2.10.v20150310)
  </code></pre>
  
  <p>My logging shows that the function requested "plain/text", but somehow the framework trumped it.</p>
  
  <pre><code>2017-01-12 18:04:47,581  INFO [qtp789647098-46]kthxbye.v1.api [669dee08-0c92-4fb4-867f-67ff08d7b72f] - response is {:status 200, :headers {"Content-Type" "text/plain"}, :body "frickin compojure-api"}
  </code></pre>
  
  <p>How do I gain control over Content-Type in a Compojure-API Ring application?</p>