title: How to customize response content type in flask-restful?
body: <p>I want to be able to return something other than application/json i.e. kml.</p>
  
  <p>I have the following:</p>
  
  <pre><code>@api.representation('application/vnd.google-earth.kml+xml')
  def kml(data):
      return Response(data, mimetype='application/vnd.google-earth.kml+xml')
  
  class mykml(restful.Resource):
  
      def get(self):
          r = requests.get("http://myurl/kml") # This retrieves a .kml file   
          response = make_response(r.content)
          response.headers['Content-Type'] = "application/vnd.google-earth.kml+xml"
  
          return response
  </code></pre>
  
  <p>Why is this still returning application/json? Also, if I have different formats, can I dynamically change the Content-Type of the respone within class mykml without the decorator?</p>
  
  <p>Imports:    <code>from flask import Flask, request, Response, session,make_response</code></p>